Esempio n. 1
0
        public void Clear(ColorScheme scheme)
        {
            ColorScheme saved = ColorScheme.Get();
            scheme.Set();

            string s = new string(' ', _size.Width);
            for (int i = 0; i < _size.Height; i++)
            {
                SetCursorPosition(0, i);
                Console.Write(s);
            }

            saved.Set();
        }
Esempio n. 2
0
        public void Write(ColorScheme scheme, string fmt, params object[] args)
        {
            ColorScheme saved = ColorScheme.Get();
            scheme.Set();

            string s = string.Format(fmt, args);
            SetCursorPosition(new Point(0, 0));
            List<string> chunks = SplitStringToChunks(s, _size.Width)
                .Take(_size.Height)
                .ToList();
            for (int i = 0; i < chunks.Count; i++)
            {
                SetCursorPosition(0, i);
                Console.Write(chunks[i]);
            }

            saved.Set();
        }