private void LoadSettings(TModel model) { Contract.Assert(model != null); // Some models persist settings, this is an optional feature IScaffoldingSettings modelSettings = model as IScaffoldingSettings; 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.LoadSettings(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); } } } }
private void LoadSettings(TModel model) { IScaffoldingSettings scaffoldingSetting = (object)model as IScaffoldingSettings; if (scaffoldingSetting != null && this.VisualStudioIntegration != null) { IProjectSettings projectSettings = this.VisualStudioIntegration.GetProjectSettings(base.Context.ActiveProject); if (projectSettings != null) { try { scaffoldingSetting.LoadSettings(projectSettings); } catch (Exception exception) { } } } }