コード例 #1
0
ファイル: ExtendedConsole.cs プロジェクト: s151910/MaxLib
        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);
                }
            }
        }
コード例 #2
0
ファイル: ExtendedConsole.cs プロジェクト: s151910/MaxLib
 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();
     }
 }