public ConsoleBuffer(int width, int height)
        {
            this.width  = width;
            this.height = height;

            this.consoleWindow = new ConsoleWindow(width, height);

            SetFont(Native.stdOutputHandle, 2, 2);

            sFileHandle = Native.CreateFile(
                "CONOUT$", 0x40000000, 2, IntPtr.Zero, FileMode.Open, 0, IntPtr.Zero
                );

            if (!sFileHandle.IsInvalid)
            {
                CharInfoBuffer = new Native.CHAR_INFO[width * height];
            }

            Native.SetConsoleMode(Native.stdInputHandle, 0x0080);
        }
 public void ClearBuffer()
 {
     CharInfoBuffer = new Native.CHAR_INFO[width * height];
 }