Ejemplo n.º 1
0
        private void HyperlinkRemoteShutdownSettings_Click(object sender, RoutedEventArgs e)
        {
            var settingsWindow = new SettingsWindow(InitTabSettings.RemoteShutdown);

            settingsWindow.ShowDialog();

            lock (this.settingsLock)
            {
                this.currentSettings = this.settingsManager.LoadSettings();
            }

            FillAllStatusPanels();
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            if (AlreadyRunning())
            {
                MessageBox.Show(Wsapm.Resources.Wsapm.MainWindow_AppAlreadyRunning, Wsapm.Resources.Wsapm.MainWindow_Title, MessageBoxButton.OK, MessageBoxImage.Information);
                App.Current.Shutdown();
                return;
            }

            ParseArgs();

            try
            {
                this.settingsLock           = new object();
                this.logManager             = new LogManager(WsapmTools.GetCommonApplicationDataFolder(), WsapmConstants.WsapmApplicationLogFile);
                this.logManager.LogChanged += logManager_LogChanged;

                InitializeComponent();

                this.serviceManager  = new ServiceManager();
                this.settingsManager = new SettingsManager();

                lock (this.settingsLock)
                {
                    this.currentSettings = this.settingsManager.LoadSettings();
                }

                this.logManager.Start();

                if (this.textBoxLog != null && this.scrollViewerLog != null)
                {
                    this.textBoxLog.Text = this.logManager.Log; // Load current log manually for the first time.
                    this.scrollViewerLog.ScrollToEnd();
                }

                this.temporaryUptimeManager = new TemporaryUptimeManager();
            }
            catch (Exception ex)
            {
                UnhandledExceptionManager.HandleException(ex);
            }
        }