internal void CopyFrom(ConsoleCellData ccd) { Data = ccd.Data; BackGroundColor = ccd.BackGroundColor; TextColor = ccd.TextColor; RePaint = ccd.RePaint; }
public ConsoleHelper(int width, int height, bool ShowCursor) { this.width = width; this.height = height; active = new ConsoleCellData[width, height]; buffer = new ConsoleCellData[width, height]; for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { active[x, y] = new ConsoleCellData(); buffer[x, y] = new ConsoleCellData(); } } try { Console.SetWindowSize(width, height); Console.SetBufferSize(width, height); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } Console.CursorVisible = ShowCursor; Console.CancelKeyPress += Console_CancelKeyPress; (Updater = new Thread(Updating) { Name = "ConsoleHelper Updater Thread" }).Start(); }
public void BeginWrite() { if (buffer != null) { throw new InvalidOperationException(); } buffer = new ConsoleCellData[ConsoleHelper.width, ConsoleHelper.height]; for (int x = 0; x < ConsoleHelper.width; ++x) { for (int y = 0; y < ConsoleHelper.height; ++y) { buffer[x, y] = new ConsoleCellData(); } } }