Exemplo n.º 1
0
 private void AppWindow_Remove(ucAppWindow AppWindow)
 {
     lock (_appWindows)
     {
         if (_appWindows_rev.ContainsKey(AppWindow))
         {
             // Unhook events
             AppWindow.LineEntered -= AppWindow_LineEntered;
             // Delete from list
             string name = _appWindows_rev[AppWindow];
             _appWindows.Remove(name);
             _appWindows_rev.Remove(AppWindow);
         }
     }
 }
Exemplo n.º 2
0
        private void AppWindow_Remove(string AppWindowName)
        {
            lock (_appWindows)
            {
                if (_appWindows.ContainsKey(AppWindowName))
                {
                    ucAppWindow AppWindow = _appWindows[AppWindowName];

                    // Unhook events
                    AppWindow.LineEntered -= AppWindow_LineEntered;

                    // Delete from list
                    _appWindows.Remove(AppWindowName);
                    _appWindows_rev.Remove(AppWindow);
                }
            }
        }
Exemplo n.º 3
0
        void Program_AppConsoleOutput(string App, string LogText)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Program_AppConsoleOutputDelegate(Program_AppConsoleOutput), App, LogText);
                return;
            }

            // Get app window
            ucAppWindow aw = AppWindow_Get(App);

            // Write text to it
            if (aw != null)
            {
                aw.Write(System.Drawing.Color.Black, LogText);
            }
        }
Exemplo n.º 4
0
        public void Program_AppRemoved(string App)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Program_AppRemovedDelegate(Program_AppRemoved), App);
                return;
            }

            Trace.WriteLine("Stop: " + App);

            // Get app window
            ucAppWindow aw = AppWindow_Get(App);

            if (aw == null)
            {
                return;
            }

            // Get its tab page
            TabPage tp = aw.Parent as TabPage;

            if (tp != null)
            {
                // Remove tab page from tab control
                tabControl1.TabPages.Remove(tp);

                // Remove app window from tab
                tp.Controls.Remove(aw);
            }

            // Dispose of app window
            aw.Dispose();

            // Dispose of tab page
            if (tp != null)
            {
                tp.Dispose();
            }

            // Remove from our internal list
            AppWindow_Remove(App);
        }
Exemplo n.º 5
0
        public void Program_AppCreated(string App)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Program_AppCreatedDelegate(Program_AppCreated), App);
                return;
            }

            Trace.WriteLine("Start: " + App);

            // Do we already have app window for that app?
            if (AppWindow_Get(App) != null)
            {
                return;
            }

            // New log window
            ucAppWindow aw = new ucAppWindow();

            // New tab page
            TabPage tp = new TabPage(App);

            // Add log window into tab page
            tp.Controls.Add(aw);

            // Add tab page into tab control
            tabControl1.TabPages.Add(tp);

            // Add it all to our internal list
            AppWindow_Add(App, aw);

            // Hook up events
            aw.LineEntered += AppWindow_LineEntered;

            // Fill log window fully inside tab page
            aw.Dock = DockStyle.Fill;
        }
Exemplo n.º 6
0
        public void Program_AppCreated(string App)
        {
            if (this.InvokeRequired) {
                this.Invoke(new Program_AppCreatedDelegate(Program_AppCreated), App);
                return;
            }

            Trace.WriteLine("Start: " + App);

            // Do we already have app window for that app?
            if (AppWindow_Get(App) != null)
                return;

            // New log window
            ucAppWindow aw = new ucAppWindow();
            // New tab page
            TabPage tp = new TabPage(App);
            // Add log window into tab page
            tp.Controls.Add(aw);
            // Add tab page into tab control
            tabControl1.TabPages.Add(tp);
            // Add it all to our internal list
            AppWindow_Add(App, aw);
            // Hook up events
            aw.LineEntered += AppWindow_LineEntered;

            // Fill log window fully inside tab page
            aw.Dock = DockStyle.Fill;
        }
Exemplo n.º 7
0
 private string AppWindow_Get(ucAppWindow AppWindow)
 {
     lock (_appWindows)
     {
         if (_appWindows_rev.ContainsKey(AppWindow))
             return _appWindows_rev[AppWindow];
     }
     return null;
 }
Exemplo n.º 8
0
 private void AppWindow_Remove(ucAppWindow AppWindow)
 {
     lock (_appWindows)
     {
         if (_appWindows_rev.ContainsKey(AppWindow))
         {
             // Unhook events
             AppWindow.LineEntered -= AppWindow_LineEntered;
             // Delete from list
             string name = _appWindows_rev[AppWindow];
             _appWindows.Remove(name);
             _appWindows_rev.Remove(AppWindow);
         }
     }
 }
Exemplo n.º 9
0
 private void AppWindow_Add(string AppWindowName, ucAppWindow AppWindow)
 {
     lock (_appWindows)
     {
         _appWindows.Add(AppWindowName, AppWindow);
         _appWindows_rev.Add(AppWindow, AppWindowName);
         // Hook events
         AppWindow.LineEntered += AppWindow_LineEntered;
     }
 }
Exemplo n.º 10
0
 private void AppWindow_LineEntered(ucAppWindow AppWindow, string LogText)
 {
     Program.WriteLine(AppWindow_Get(AppWindow), LogText);
 }
Exemplo n.º 11
0
 private void AppWindow_LineEntered(ucAppWindow AppWindow, string LogText)
 {
     Program.WriteLine(AppWindow_Get(AppWindow), LogText);
 }