public void AddApplicationControl(IApplicationControl control)
 {
     if (control is UIElement uiElement)
     {
         ApplicationPanel.Children.Add(uiElement);
     }
 }
Beispiel #2
0
        private void TabControlMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            lock (_lockUI)
            {
                IApplicationControl control = CurrentControl;
                if (null != control && !string.IsNullOrWhiteSpace(control.ControlName))
                {
                    control.UpdateDisplayContent(ToolStripMenuItemShowTime.Checked, ToolStripMenuItemShowMachine.Checked, ToolStripMenuItemShowAppDomain.Checked);
                    TabControlMain.SelectedTab.Text = control.ControlName;
                }
                else
                {
                    switch (TabControlMain.SelectedIndex)
                    {
                    case 0:
                        TabControlMain.TabPages[0].Text = "Console";
                        ConsoleUI.UpdateDisplayContent(ToolStripMenuItemShowTime.Checked, ToolStripMenuItemShowMachine.Checked, ToolStripMenuItemShowAppDomain.Checked);
                        break;

                    case 1:
                        TabControlMain.TabPages[1].Text = "Channels";
                        ChannelUI.UpdateDisplayContent(ToolStripMenuItemShowTime.Checked, ToolStripMenuItemShowMachine.Checked, ToolStripMenuItemShowAppDomain.Checked);
                        break;
                    }
                }
            }
        }
Beispiel #3
0
 private void ToolStripMenuItemShowTime_CheckedChanged(object sender, EventArgs e)
 {
     lock (_lockUI)
     {
         IApplicationControl control = CurrentControl;
         if (null != control)
         {
             control.UpdateDisplayContent(ToolStripMenuItemShowTime.Checked, ToolStripMenuItemShowMachine.Checked, ToolStripMenuItemShowAppDomain.Checked);
         }
     }
 }
 public void AddApplicationControl(IApplicationControl control, bool atFirstPosition = false)
 {
     if (control is UIElement uiElement)
     {
         if (atFirstPosition)
         {
             ApplicationStackPanel.Children.Insert(0, uiElement);
         }
         else
         {
             ApplicationStackPanel.Children.Add(uiElement);
         }
     }
 }
Beispiel #5
0
        /// <summary>
        /// Clear all view content
        /// </summary>
        private void ClearAllDisplayContent()
        {
            lock (_lockUI)
            {
                List <TabPage> removePages = new List <TabPage>();
                ConsoleUI.Clear();
                ChannelUI.Clear();
                foreach (var item in CustomConsoleList)
                {
                    item.Clear();
                }
                int i = 0;
                foreach (TabPage item in TabControlMain.TabPages)
                {
                    IApplicationControl appControl = item.Controls[0] as IApplicationControl;
                    if (null != appControl && !String.IsNullOrWhiteSpace(appControl.ControlName))
                    {
                        item.Text = appControl.ControlName;
                    }

                    if (i > 2)
                    {
                        removePages.Add(item);
                    }

                    i++;
                }
                TabControlMain.TabPages[0].Text = "Console";
                TabControlMain.TabPages[1].Text = "Channels";

                foreach (TabPage item in removePages)
                {
                    TabControlMain.TabPages.Remove(item);
                }
            }
        }
Beispiel #6
0
 public bool IsCurrentlyVisible(IApplicationControl control)
 {
     return(control == CurrentControl);
 }
Beispiel #7
0
 public bool IsCurrentlyVisible(IApplicationControl control)
 {
     return control == CurrentControl;
 }
 public void RegisterApplicationControl(IApplicationControl control)
 {
     control.Clicked += ApplicationControl_Clicked;
     controls.Add(control);
 }