Beispiel #1
0
        static void Main(string[] args)
        {
            var c = new FinchConsole();

            c.WriteLine("Welcome to the Finch Demo app!");
            c.WriteLine();

            c.Write("Press any key for the VIEW demo...");
            c.ReadKey();

            c.ClearScreen();
            ViewDemos(c);
            c.ClearScreen();

            c.WriteLine("Press any key for the STYLE demo, please resize the window to be larger than 128x63...");
            c.WriteLine("... as the program won't let you continue until you do that :)");
            var cs = c.GetSize();

            c.ReadKey();
            while (cs.x < 63 || cs.y < 128)
            {
                c.ReadKey();
                cs = c.GetSize();
            }

            c.ClearScreen();
            StyleDemos(c);
            c.ClearScreen();

            c.Write("Press any key to quit...");
            c.ReadKey();
        }
Beispiel #2
0
        private static void ViewDemos(FinchConsole c)
        {
            c.WriteLine("TEST FROZEN LINE 1");
            c.WriteLine("TEST FROZEN LINE 2");

            var size = c.GetSize();

            c.MoveCursorInColumn(size.x - 1);

            c.WriteLine("TEST FROZEN LINE 3");
            c.Write("TEST FROZEN LINE 4");

            c.SetCursorPosition(3, 0);

            c.FreezeLines(2, 2);

            foreach (var i in Enumerable.Range(1, 100))
            {
                c.WriteLine(i.ToString());
                Thread.Sleep(10);
            }

            for (var i = 0; i < 10; i++)
            {
                c.ScrollUp(1);
                Thread.Sleep(20);
            }

            for (var i = 0; i < 10; i++)
            {
                c.ScrollDown(1);
                Thread.Sleep(20);
            }

            c.UnfreezeLines();
        }