private void ServerMonitor_Click(object sender, RoutedEventArgs e) { var window = ServerMonitorWindow.GetWindow(ServerManager); window.Closed += Window_Closed; window.Show(); if (window.WindowState == WindowState.Minimized) { window.WindowState = WindowState.Normal; } window.Focus(); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { base.OnClosing(e); RCONWindow.CloseAllWindows(); PlayerListWindow.CloseAllWindows(); ServerMonitorWindow.CloseAllWindows(); this.versionChecker.DisposeAsync().DoNotWait(); var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var backupFolder = IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath) ? Path.Combine(Config.Default.DataDir, Config.Default.BackupDir) : Path.Combine(Config.Default.BackupPath)); SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder); SettingsUtils.BackupUserConfigSettings(CommonConfig.Default, "commonconfig.json", installFolder, backupFolder); }