From 1c70b20028debd9cd24ebd573b8c7b85580872f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zi=C4=85bek?= Date: Mon, 31 Jan 2022 00:15:10 +0100 Subject: [PATCH] Added examples for execution order --- QuestPDF.Examples/ExecutionOrderExamples.cs | 76 +++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 QuestPDF.Examples/ExecutionOrderExamples.cs diff --git a/QuestPDF.Examples/ExecutionOrderExamples.cs b/QuestPDF.Examples/ExecutionOrderExamples.cs new file mode 100644 index 0000000..1fed408 --- /dev/null +++ b/QuestPDF.Examples/ExecutionOrderExamples.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using QuestPDF.Drawing.Exceptions; +using QuestPDF.Examples.Engine; +using QuestPDF.Fluent; +using QuestPDF.Helpers; +using QuestPDF.Infrastructure; + +namespace QuestPDF.Examples +{ + public class ExecutionOrderExamples + { + [Test] + public void Example() + { + RenderingTest + .Create() + .PageSize(400, 300) + .ProduceImages() + .ShowResults() + .Render(container => + { + container + .DefaultTextStyle(TextStyle.Default.Size(18)) + .Padding(25) + .Row(row => + { + row.Spacing(25); + + row.RelativeItem() + .Border(1) + .Padding(15) + .Background(Colors.Grey.Lighten2) + .Text("Lorem ipsum"); + + row.RelativeItem() + .Border(1) + .Background(Colors.Grey.Lighten2) + .Padding(15) + .Text("dolor sit amet"); + }); + }); + } + + [Test] + public void Example2() + { + RenderingTest + .Create() + .PageSize(200, 200) + .ProduceImages() + .ShowResults() + .Render(container => + { + container + .Padding(25) + .Border(2) + .Width(150) + .Height(150) + + .Background(Colors.Blue.Lighten2) + .PaddingTop(50) + + .Background(Colors.Green.Lighten2) + .PaddingRight(50) + + .Background(Colors.Red.Lighten2) + .PaddingBottom(50) + + .Background(Colors.Amber.Lighten2) + .PaddingLeft(50) + + .Background(Colors.Grey.Lighten2); + }); + } + } +} \ No newline at end of file