예제 #1
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));
            }
        }
예제 #2
0
        public bool CheckNotificationShowTest(bool onlyIfChanged, ObservationState currentState, ObservationState historyState1, ObservationState historyState2, ObservationState historyState3, ObservationState historyState4)
        {
            var observationScheduler = new ObservationScheduler();
            var configuration        = new ApplicationConfiguration();

            configuration.OpenMinimized = true;
            var trayHandler = new TrayHandler(observationScheduler, configuration);

            var connectorViewModel = new ConnectorViewModel();
            var statusViewModel    = new StatusViewModel(connectorViewModel);

            statusViewModel.State = currentState;
            var status1 = new BuildStatusViewModel(connectorViewModel)
            {
                State = currentState
            };
            var status2 = new BuildStatusViewModel(connectorViewModel)
            {
                State = historyState1
            };
            var status3 = new BuildStatusViewModel(connectorViewModel)
            {
                State = historyState2
            };
            var status4 = new BuildStatusViewModel(connectorViewModel)
            {
                State = historyState3
            };
            var status5 = new BuildStatusViewModel(connectorViewModel)
            {
                State = historyState4
            };

            connectorViewModel.ConnectorSnapshots.Add(status5);
            connectorViewModel.ConnectorSnapshots.Add(status4);
            connectorViewModel.ConnectorSnapshots.Add(status3);
            connectorViewModel.ConnectorSnapshots.Add(status2);
            connectorViewModel.ConnectorSnapshots.Add(status1);

            var notificationConfiguration = new NotificationConfiguration();

            notificationConfiguration.OnlyIfChanged = onlyIfChanged;
            notificationConfiguration.RunningNotificationEnabled = false;

            return(trayHandler.CheckNotificationShow(statusViewModel, currentState, notificationConfiguration));
        }
예제 #3
0
        /// <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));
                }
            }
        }
예제 #4
0
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     SaveSettings();
     UpdateHandler.Dispose();
     TrayHandler.Dispose();
 }