Exemplo n.º 1
0
        public ExtendedConsole(ExtendedConsoleOptions Options)
        {
            this.Options  = Options;
            Options.Owner = this;

            Matrix = new ExtendedConsoleCellMatrix();
            var s = System.Windows.Forms.Screen.AllScreens[0].Bounds.Size;

            Matrix.SetSize(s.Width / Options.BoxWidth, s.Height / Options.BoxHeight);
            Matrix.Changed = OptionsChanged;

            KeyManager             = new In.KeyManager();
            Marker                 = new ExtendedConsoleMarker(this);
            Cursor                 = new In.Cursor(this);
            MainContainer          = new Elements.ElementContainer();
            MainContainer.Changed += () =>
            {
                if (Form != null)
                {
                    Flush();
                }
            };

            if (Options.RunFormInExtraThread)
            {
                Viewer      = new System.Threading.Thread(StartViewer);
                Viewer.Name = "Viewer Thread";
                Viewer.Start();
                while (Form == null || !Form.Visible)
                {
                    System.Threading.Thread.Sleep(1);
                }
            }
        }
Exemplo n.º 2
0
 public void ClearData(ExtendedConsoleOptions options)
 {
     foreach (var x in matrix)
     {
         foreach (var c in x)
         {
             c.Value      = (char)0;
             c.Background = options.Background;
             c.Foreground = options.Foreground;
         }
     }
     if (Changed != null)
     {
         Changed();
     }
 }