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; } } } }
/// <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); }
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>(); }
/// <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)); } }
/// <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); } } }