protected void SaveDialogSettings() { IDialogSettings dialogSetting = this as IDialogSettings; IVisualStudioIntegration property = this.Context.Items.GetProperty <IVisualStudioIntegration>(typeof(IVisualStudioIntegration)); if (dialogSetting != null && property != null) { IProjectSettings projectSettings = property.GetProjectSettings(this.Context.ActiveProject); if (projectSettings != null) { try { dialogSetting.SaveDialogSettings(projectSettings); } catch (Exception exception) { } } } }
protected void SaveDialogSettings() { IDialogSettings modelSettings = this as IDialogSettings; IVisualStudioIntegration visualStudioIntegration = Context.Items.GetProperty <IVisualStudioIntegration>(typeof(IVisualStudioIntegration)); if (modelSettings != null && visualStudioIntegration != null) { // The project settings will be null if the project doesn't implement settings (project systems are // extensible). IProjectSettings projectSettings = visualStudioIntegration.GetProjectSettings(Context.ActiveProject); if (projectSettings != null) { try { modelSettings.SaveDialogSettings(projectSettings); } catch (Exception ex) { // We don't want to make it a blocking issue if we're unable to save settings. Debug.Fail("Failed to save settings", ex.Message); } } } }