예제 #1
0
        /// <summary>
        /// Initializes the extended console
        /// </summary>
        /// <param name="width">Buffer area width</param>
        /// <param name="height">Buffer are height</param>
        /// <returns></returns>
        public static bool Init(int width, int height)
        {
            if (enabled)
            {
                return(false);
            }

            Console.Clear();
            Console.CursorVisible = false;
            bg = ConsoleColor.Black;
            fg = ConsoleColor.Gray;
            ConsoleBase.width  = Console.BufferWidth = Console.WindowWidth = width;
            ConsoleBase.height = Console.BufferHeight = Console.WindowHeight = height;
            cbuf = new ConsoleBuffer[width, height];
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    cbuf[i, j] = new ConsoleBuffer();
                }
            }
            forms = new List <Form>();
            ConsoleKeyPress.Init();
            ckp     = new ConsoleKeyPress();
            enabled = true;
            return(true);
        }
예제 #2
0
        /// <summary>
        /// Deinitializes the extended console
        /// </summary>
        /// <returns></returns>
        public static bool DeInit()
        {
            if (!enabled)
            {
                return(false);
            }

            ConsoleKeyPress.DeInit();
            enabled = false;
            NativeClass.NullThread(ref thd);
            return(true);
        }
예제 #3
0
 static Control()
 {
     ckp = new ConsoleKeyPress();
     EnableHandlers(true);
 }