internal SettingsWindow(ServiceMonitor monitor, ProductInfoManager productInfoManager)
 {
     SetValue(MonitorProperty, monitor); ;
     SetValue(ProductInfoProperty, productInfoManager);
     SetValue(ConfigManagerProperty, ConfigurationManager.Instance);
     InitializeComponent();
 }
예제 #2
0
 internal SettingsWindow(ServiceMonitor monitor, ProductInfoManager productInfoManager)
 {
     SetValue(MonitorProperty, monitor);;
     SetValue(ProductInfoProperty, productInfoManager);
     SetValue(ConfigManagerProperty, ConfigurationManager.Instance);
     InitializeComponent();
 }
예제 #3
0
        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;
        }
예제 #4
0
        private void btnAutostart_Click(object sender, RoutedEventArgs e)
        {
            btnAutostart.IsEnabled = false;
            ServiceMonitor.TrySetAutoStartService();
            Timer t = new Timer(buttonDisableDurationMs);

            t.Elapsed += tbtnAutostart_Elapsed;
            t.Start();
        }
예제 #5
0
        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();
        }
예제 #6
0
        void UpdateStatus()
        {
            ServiceRunning   = ServiceMonitor.ProcessIsRunning();
            ServiceInstalled = ServiceMonitor.GetServiceController() != null;
            ServiceIsAuto    = ServiceMonitor.ServiceIsAutostart();

            UpdateApiStatus();

            SystemGo = NameCoinOnline && NameServerOnline;

            if (OnStatusUpdated != null)
            {
                OnStatusUpdated(this, new EventArgs()
                {
                });
            }
        }