private void Process_Click(object sender, RoutedEventArgs e) { var cursor = this.Cursor; try { if (string.IsNullOrWhiteSpace(SelectedProfileId)) { MessageBox.Show(_globalizer.GetResourceString("ProfileSyncWindow_Process_NoProfileSelectedLabel"), _globalizer.GetResourceString("ProfileSyncWindow_Process_Title"), MessageBoxButton.OK, MessageBoxImage.Error); return; } if (!ProfileSections.Any(s => s.Selected)) { MessageBox.Show(_globalizer.GetResourceString("ProfileSyncWindow_Process_NoSectionsSelectedLabel"), _globalizer.GetResourceString("ProfileSyncWindow_Process_Title"), MessageBoxButton.OK, MessageBoxImage.Error); return; } if (MessageBox.Show(_globalizer.GetResourceString("ProfileSyncWindow_Process_Label"), _globalizer.GetResourceString("ProfileSyncWindow_Process_Title"), MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes) { return; } Application.Current.Dispatcher.Invoke(() => this.Cursor = System.Windows.Input.Cursors.Wait); PerformProfileSync(); MessageBox.Show(_globalizer.GetResourceString("ProfileSyncWindow_Process_SuccessLabel"), _globalizer.GetResourceString("ProfileSyncWindow_Process_Label"), MessageBoxButton.OK, MessageBoxImage.Information); DialogResult = true; Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, _globalizer.GetResourceString("ProfileSyncWindow_Process_FailedTitle"), MessageBoxButton.OK, MessageBoxImage.Error); } finally { Application.Current.Dispatcher.Invoke(() => this.Cursor = cursor); } }
private void CreateProfileSectionList() { ProfileSections.Clear(); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.AdministrationSection, SectionName = _globalizer.GetResourceString("ServerSettings_AdministrationSectionLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.AutomaticManagement, SectionName = _globalizer.GetResourceString("ServerSettings_AutomaticManagementLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.RulesSection, SectionName = _globalizer.GetResourceString("ServerSettings_RulesLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.ChatAndNotificationsSection, SectionName = _globalizer.GetResourceString("ServerSettings_ChatAndNotificationsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.HudAndVisualsSection, SectionName = _globalizer.GetResourceString("ServerSettings_HUDAndVisualsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.PlayerSettingsSection, SectionName = _globalizer.GetResourceString("ServerSettings_PlayerSettingsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.DinoSettingsSection, SectionName = _globalizer.GetResourceString("ServerSettings_DinoSettingsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.EnvironmentSection, SectionName = _globalizer.GetResourceString("ServerSettings_EnvironmentLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.StructuresSection, SectionName = _globalizer.GetResourceString("ServerSettings_StructuresLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.EngramsSection, SectionName = _globalizer.GetResourceString("ServerSettings_EngramsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.CustomSettingsSection, SectionName = _globalizer.GetResourceString("ServerSettings_CustomSettingsLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.CustomLevelsSection, SectionName = _globalizer.GetResourceString("ServerSettings_CustomLevelProgressionsLabel") }); if (Config.Default.SectionCraftingOverridesEnabled) { ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.CraftingOverridesSection, SectionName = _globalizer.GetResourceString("ServerSettings_CraftingOverridesLabel") }); } if (Config.Default.SectionMapSpawnerOverridesEnabled) { ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.MapSpawnerOverridesSection, SectionName = _globalizer.GetResourceString("ServerSettings_MapSpawnerOverridesLabel") }); } if (Config.Default.SectionSupplyCrateOverridesEnabled) { ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.SupplyCrateOverridesSection, SectionName = _globalizer.GetResourceString("ServerSettings_SupplyCrateOverridesLabel") }); } ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.PGMSection, SectionName = _globalizer.GetResourceString("ServerSettings_PGMLabel") }); ProfileSections.Add(new ProfileSection() { Selected = false, Section = ServerProfile.ServerProfileSection.SOTFSection, SectionName = _globalizer.GetResourceString("ServerSettings_SOTFLabel") }); }