コード例 #1
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;
                    }
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public FormMain()
 {
     InitializeComponent();
     EnumerateScreens();
     ConsoleUI.Host = this;
     ChannelUI.Host = this;
     toolStripStatusLabelAttention.Visible = IsRunningWithAdminPrivileges;
     CustomConsoleList = new CustomConsoleCollection();
     LoadSettings();
     ChannelUI.UpdateViewOptions(ToolStripMenuItemShowTime.Checked, ToolStripMenuItemShowMachine.Checked, ToolStripMenuItemShowAppDomain.Checked);
 }
コード例 #3
0
 public void SelectChannel(SelectChannelEvent e, ChannelUI selectedChannel, [JoinAll] Optional <ActiveChannel> activeChannel)
 {
     if (activeChannel.IsPresent())
     {
         if (ReferenceEquals(selectedChannel.Entity, activeChannel.Get().Entity))
         {
             return;
         }
         activeChannel.Get().chatChannelUI.Deselect();
         activeChannel.Get().Entity.RemoveComponent <ActiveChannelComponent>();
     }
     selectedChannel.chatChannelUI.Select();
     selectedChannel.Entity.AddComponent <ActiveChannelComponent>();
 }
コード例 #4
0
        /// <summary>
        /// Display incoming channel message
        /// </summary>
        /// <param name="notifyTime"></param>
        /// <param name="appDomainFriendlyName"></param>
        /// <param name="name"></param>
        /// <param name="message"></param>
        private string ShowChannelMessage(string notifyTime, string channelName, string machineName, string appDomainFriendlyName, string parentEntryID, string message, bool showTime, bool showMachine, bool showAppDomain)
        {
            if (ChannelUI.InvokeRequired)
            {
                return(ChannelUI.Invoke(new UpdateMonitorInvoker(ShowChannelMessage), new object[] { notifyTime, channelName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain }) as string);
            }

            lock (_lockUI)
            {
                TrayHandler.ShowUpdate();
                if (CurrentControl != ChannelUI)
                {
                    TabControlMain.TabPages[1].Text = "*Channels";
                }
                return(ChannelUI.AddNewMessage(notifyTime, channelName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain));
            }
        }
コード例 #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);
                }
            }
        }