/// <summary> /// Saves the settings. /// </summary> /// <returns></returns> bool SaveSettings() { if (CurrentEnvironment.IsConnected) { if (CurrentEnvironment.AuthorizationService.IsAuthorized(AuthorizationContext.Administrator, null)) { // Need to reset sub view models so that selecting something in them fires our OnIsDirtyPropertyChanged() ClearErrors(); if (!ValidateDuplicateResourcePermissions()) { return(false); } if (!ValidateDuplicateServerPermissions()) { return(false); } if (!ValidateResourcePermissions()) { return(false); } SecurityViewModel.Save(Settings.Security); if (!SaveLogSettingsChanges()) { return(false); } if (PerfmonViewModel.IsDirty) { PerfmonViewModel.Save(Settings.PerfCounters); } var isWritten = WriteSettings(); if (isWritten) { ResetIsDirtyForChildren(); IsSaved = true; IsDirty = false; ClearErrors(); } else { IsSaved = false; IsDirty = true; } return(IsSaved); } ShowError(StringResources.SaveErrorPrefix, StringResources.SaveSettingsPermissionsErrorMsg); _popupController.ShowSaveSettingsPermissionsErrorMsg(); return(false); } ShowError(StringResources.SaveErrorPrefix, StringResources.SaveServerNotReachableErrorMsg); _popupController.ShowSaveServerNotReachableErrorMsg(); return(false); }