public override void LoadSettings(VisualStudio.IProjectSettings settings) { // TODO - Right now this class inherits from the view scaffolder model, so we need to call into the // base class to read those settings as well. We want to remove this inheritance at some point // and this method will have to change when we do. base.LoadSettings(settings); bool value; if (IsViewGenerationSupported) { if (settings.TryGetBool(SavedSettingsKeys.IsViewGenerationSelectedKey, out value)) { IsViewGenerationSelected = value; } else { // default to true if views are supported and we have no saved state IsViewGenerationSelected = true; } } if (IsAsyncSupported) { if (settings.TryGetBool(SavedSettingsKeys.IsAsyncSelectedKey, out value)) { IsAsyncSelected = value; } } }
public void SaveSettings(VisualStudio.IProjectSettings settings) { // TODO - Right now this class inherits from the view scaffolder model, so we need to call into the // base class to save those settings as well. We want to remove this inheritance at some point // and this method will have to change when we do. if (DataContextType != null) { settings[SavedSettingsKeys.DbContextTypeFullNameKey] = DataContextType.TypeName; } if (ConfigType != null) { settings[SavedSettingsKeys.ConfigTypeFullNameKey] = ConfigType.TypeName; } }
public void LoadSettings(VisualStudio.IProjectSettings settings) { // TODO - Right now this class inherits from the view scaffolder model, so we need to call into the // base class to read those settings as well. We want to remove this inheritance at some point // and this method will have to change when we do. Contract.Assert(settings != null); string stringValue; if (settings.TryGetString(SavedSettingsKeys.DbContextTypeFullNameKey, out stringValue)) { DataContextType = DataContextTypes.Where(t => String.Equals(t.TypeName, stringValue, StringComparison.Ordinal)).FirstOrDefault(); } if (settings.TryGetString(SavedSettingsKeys.ConfigTypeFullNameKey, out stringValue)) { ConfigType = ConfigTypes.Where(t => String.Equals(t.TypeName, stringValue, StringComparison.Ordinal)).FirstOrDefault(); } }
public override void SaveSettings(VisualStudio.IProjectSettings settings) { // TODO - Right now this class inherits from the view scaffolder model, so we need to call into the // base class to save those settings as well. We want to remove this inheritance at some point // and this method will have to change when we do. base.SaveSettings(settings); // We only want to save this value if this scaffolder uses views. // // Ex: Using the 'empty controller' scaffolder and then going back to 'Controller + EF + Views' should // not uncheck the box for you. if (IsViewGenerationSupported) { settings.SetBool(SavedSettingsKeys.IsViewGenerationSelectedKey, IsViewGenerationSelected); } if (IsAsyncSupported) { settings.SetBool(SavedSettingsKeys.IsAsyncSelectedKey, IsAsyncSelected); } }