public static void OnProcessCountChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { SessionMonitor me = sender as SessionMonitor; if (me != null) { me.NotifyIcon.ToolTipText = Locations.AssemblyTitle + "\r\n\r\nCurrent Artemis Session Count: " + me.ProcessCount.ToString() + "\r\n\r\nClick to start another Artemis session."; me.txCount.Text = me.ProcessCount.ToString(); if (me.ProcessCount < 1) { me.Close(); } } }
private void RunArtemis_Click(object sender, RoutedEventArgs e) { if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); } if (this.SelectedIPAddress != Locations.GetCurrentIPAddress()) { if (!Locations.SetIPAddress(this.SelectedIPAddress)) { Locations.MessageBoxShow("Unable to set the Server IP address.\r\n\r\nReview log file for details as to why.", MessageBoxButton.OK, MessageBoxImage.Information); } } Window thiswin = Window.GetWindow(this); thiswin.ShowInTaskbar = false; SessionMonitor win = new SessionMonitor(); win.StartSession(); DoAnimation(); win.ShowDialog(); thiswin.ShowInTaskbar = true; thiswin.WindowState = System.Windows.WindowState.Normal; string newIP = Locations.GetCurrentIPAddress(); if (!IPAddresses.Contains(newIP)) { Locations.AddToIPList(newIP); IPAddresses.Add(newIP); SelectedIPAddress = newIP; } if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); } }