protected void LoadDialogSettings() { // Some models persist settings, this is an optional feature 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.LoadDialogSettings(projectSettings); } catch (Exception ex) { // We don't want to make it a blocking issue if we're unable to load settings. Debug.Fail("Failed to load settings\r\n" + ex.Message); } } } }
protected void LoadDialogSettings() { 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.LoadDialogSettings(projectSettings); } catch (Exception exception) { } } } }