/// <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> /// Display incoming console message /// </summary> /// <param name="notifyTime"></param> /// <param name="appDomainFriendlyName"></param> /// <param name="name"></param> /// <param name="message"></param> private string ShowConsoleMessage(string notifyTime, string consoleName, string machineName, string appDomainFriendlyName, string parentEntryID, string message, bool showTime, bool showMachine, bool showAppDomain) { if (ConsoleUI.InvokeRequired) { return(ConsoleUI.Invoke(new UpdateMonitorInvoker(ShowConsoleMessage), new object[] { notifyTime, consoleName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain }) as string); } lock (_lockUI) { TrayHandler.ShowUpdate(); if (String.IsNullOrWhiteSpace(consoleName)) { string resultKey = ConsoleUI.AddNewMessage(notifyTime, consoleName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain); if (TabControlMain.SelectedIndex != 0) { TabControlMain.TabPages[0].Text = "*Console"; } return(resultKey); } else { foreach (var item in CustomConsoleList) { if (item.ControlName.Trim().ToLower() == consoleName.Trim().ToLower()) { string newEntryID = item.AddNewMessage(notifyTime, consoleName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain); TabPage page = item.Parent as TabPage; if (TabControlMain.SelectedTab != page) { page.Text = "*" + item.ControlName; } return(newEntryID); } } return(AddNewConsoleAndShowMessage(notifyTime, consoleName, machineName, appDomainFriendlyName, parentEntryID, message, showTime, showMachine, showAppDomain)); } } }