internal SettingsWindow(ServiceMonitor monitor, ProductInfoManager productInfoManager) { SetValue(MonitorProperty, monitor); ; SetValue(ProductInfoProperty, productInfoManager); SetValue(ConfigManagerProperty, ConfigurationManager.Instance); InitializeComponent(); }
internal SettingsWindow(ServiceMonitor monitor, ProductInfoManager productInfoManager) { SetValue(MonitorProperty, monitor);; SetValue(ProductInfoProperty, productInfoManager); SetValue(ConfigManagerProperty, ConfigurationManager.Instance); InitializeComponent(); }
public MainWindow() { InitializeComponent(); Title = AppName + " Monitor"; lblServiceName.Content = AppName + " Service"; lblAPIName.Content = AppName + " API"; serviceMonitor = new ServiceMonitor(); serviceMonitor.OnStatusUpdated += serviceMonitor_OnStatusUpdated; serviceMonitor.SystemGoChanged += serviceMonitor_SystemGoChanged; productInfoManager = new ProductInfoManager(); ConfigFile.ConfigUpdated += NmcConfigSetter_ConfigUpdated; ConfigFile.NamecoinConfigInfo += NmcConfigSettings_NameCoinConfigInfo; NmcConfigSettings.ValidateNmcConfig(); Program.OnAdditionalInstanceSignal += OnRequestShow; this.Closing += MainWindow_Closing; this.Closed += MainWindow_Closed; this.StateChanged += MainWindow_StateChanged; MyNotifyIcon.DoubleClickCommandParameter = MyNotifyIcon; this.Loaded += MainWindow_Loaded; }
private void btnAutostart_Click(object sender, RoutedEventArgs e) { btnAutostart.IsEnabled = false; ServiceMonitor.TrySetAutoStartService(); Timer t = new Timer(buttonDisableDurationMs); t.Elapsed += tbtnAutostart_Elapsed; t.Start(); }
private void btnStop_Click(object sender, RoutedEventArgs e) { btnStop.IsEnabled = false; ServiceMonitor.TryStopService(); btnStop.ToolTip = "Trying to stop service"; Timer t = new Timer(buttonDisableDurationMs); t.Elapsed += tbtnStop_Elapsed; t.Start(); }
void UpdateStatus() { ServiceRunning = ServiceMonitor.ProcessIsRunning(); ServiceInstalled = ServiceMonitor.GetServiceController() != null; ServiceIsAuto = ServiceMonitor.ServiceIsAutostart(); UpdateApiStatus(); SystemGo = NameCoinOnline && NameServerOnline; if (OnStatusUpdated != null) { OnStatusUpdated(this, new EventArgs() { }); } }