コード例 #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
ファイル: KeyWatcher.cs プロジェクト: s151910/MaxLib
 public KeyWatcher(KeyManager manager, params Keys[] watching)
 {
     WatchingKeys = new List <Keys>(watching);
     Owner        = manager;
     manager.Bind(this);
 }