Example #1
0
        public void Link()
        {
            root.Render(SeeRawTypes.Form("Link test", c => { }));

            AssertMatches();
        }
Example #2
0
        static void RenderClientMenu()
        {
            new
            {
                Child1 = new
                {
                    Child1_1 = 11,
                    Child1_2 = 12
                },
                Child2 = new
                {
                    Child2_1 = 21,
                    Child2_2 = 22
                },
                Enum = Title.Mr,
                Link = SeeRawTypes.Form("Link", (x) => Console.WriteLine("Actionable")),
                ID   = Guid.NewGuid(),
                Time = DateTime.Now,
                Dict = new Dictionary <Guid, string> {
                    { Guid.NewGuid(), "OK" }
                },
                Prog       = progress,
                NestedList = new List <object>
                {
                    null,
                    new List <object>
                    {
                        1, 2, 3
                    },
                    new List <object>
                    {
                        1, 2, 3
                    },
                },
                ByKey = new List <X>
                {
                    new X {
                        Name = "Key 1"
                    },
                    new X {
                        Name = "Key 2"
                    }
                }
            }.Render();

            return;

            // Show a basic hello world
            "Hello World".Render();

            // Show a simple menu
            // a. create a placeholder and keep a reference to the renderTarget so we can update it later
            "Loading Menu...".Render(out var menuTarget);
            "Click on a menu item above".Render(out var contentTarget);

            // b. Create actions/menu items to update the contentTarget depending on whats invoked
            menuTarget.Value = SeeRawTypes.Navigation()
                               .WithAction("Say Hi", () => SayHi(contentTarget))
                               .WithAction("Calculator", () => Calc(contentTarget))
                               .WithAction("Show file copy progress", () => ShowProgress(contentTarget));
        }
Example #3
0
        public void Form()
        {
            root.Render(SeeRawTypes.Form("Form test", c => { }).WithInput("Text input", "default text"));

            AssertMatches();
        }