Ejemplo n.º 1
0
        protected static void DemoScrolltext()
        {
            var width   = CoEx.WindowWidth;
            var height  = CoEx.WindowHeight;
            var bheight = CoEx.BufferHeight;

            CoEx.WindowHeight = 20;
            CoEx.BufferWidth  = CoEx.WindowWidth = 40;
            CoEx.BufferHeight = ScrollText.Length + (2 * CoEx.WindowHeight);

            ulong pos = CoEx.RealCursorY;

            for (int i = 0; i < CoEx.WindowHeight; i++)
            {
                CoEx.WriteLine();
            }

            foreach (var line in ScrollText)
            {
                var temp    = line;
                var istitle = temp.StartsWith(":");
                if (istitle)
                {
                    temp = temp.Substring(1);
                }
                var row = RowConf.Create(new string[] { temp }).SetAlignment(RowConf.ALIGNCENTER);
                if (istitle)
                {
                    row = row.PresetTitle();
                }
                CoEx.WriteColumns(row);
            }

            int length = (int)(CoEx.RealCursorY - pos);

            for (int i = 0; i < CoEx.WindowHeight; i++)
            {
                CoEx.WriteLine();
            }

            CoEx.Scroll(0, (int)(pos - CoEx.RealCursorY));

            for (int i = 0; i < length; i++)
            {
                CoEx.BufferViewportY++;
                System.Threading.Thread.Sleep(600);
            }

            System.Threading.Thread.Sleep(2000);

            CoEx.WindowWidth  = CoEx.BufferWidth = width;
            CoEx.WindowHeight = height;
            CoEx.BufferHeight = bheight;
        }
Ejemplo n.º 2
0
        protected static void DemoBasicColumns()
        {
            CoEx.WriteTitleLarge("Basic column system, no custom column length, no custom formatting");
            CoEx.WriteLine();

            // loop both exampledata arrays
            foreach (var data in new string[][][] { exambledata, exambledatalong })
            {
                // print single row from one of the exampledata arrays
                foreach (var row in data)
                {
                    CoEx.WriteColumns(row); // print the row
                }
            }
        }