Exemple #1
0
 internal void CopyFrom(ConsoleCellData ccd)
 {
     Data            = ccd.Data;
     BackGroundColor = ccd.BackGroundColor;
     TextColor       = ccd.TextColor;
     RePaint         = ccd.RePaint;
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 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();
         }
     }
 }