Beispiel #1
0
 /// <summary>
 /// Save all options. (Persist between sessions.)
 /// </summary>
 public void Save(ProvideSavedSettings settingsProvider)
 {
     if (settingsProvider == null)
     {
         throw new InvalidOperationException("P4Options.Save called without a settings provider.");
     }
     Save(OptionName.SettingIds.UseP4Config, UseP4Config.ToString(), settingsProvider);
     Save(OptionName.SettingIds.Server, Server, settingsProvider);
     Save(OptionName.SettingIds.User, User, settingsProvider);
     Save(OptionName.SettingIds.Password, Password, settingsProvider);
     Save(OptionName.SettingIds.Workspace, Workspace, settingsProvider);
     Save(OptionName.SettingIds.LogLevel, LogLevel.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsCheckoutEnabled, IsCheckoutEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsAddEnabled, IsAddEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsRevertIfUnchangedEnabled, IsRevertIfUnchangedEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsRevertEnabled, IsRevertEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.PromptBeforeRevert, PromptBeforeRevert.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsGetLatestRevisionEnabled, IsGetLatestRevisionEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsViewRevisionHistoryEnabled, IsViewRevisionHistoryEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsViewDiffEnabled, IsViewDiffEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IsViewTimeLapseEnabled, IsViewTimeLapseEnabled.ToString(), settingsProvider);
     Save(OptionName.SettingIds.AutoCheckoutOnEdit, AutoCheckoutOnEdit.ToString(), settingsProvider);
     Save(OptionName.SettingIds.AutoCheckoutOnSave, AutoCheckoutOnSave.ToString(), settingsProvider);
     Save(OptionName.SettingIds.AutoAdd, AutoAdd.ToString(), settingsProvider);
     Save(OptionName.SettingIds.AutoDelete, AutoDelete.ToString(), settingsProvider);
     Save(OptionName.SettingIds.IgnoreFilesNotUnderP4Root2, IgnoreFilesNotUnderP4Root.ToString(), settingsProvider);
     Save(OptionName.SettingIds.Version180OrAfter, "true", settingsProvider);
 }
Beispiel #2
0
 /// <summary>
 /// Save all options. (Persist between sessions.)
 /// </summary>
 public void Save(ProvideSavedSettings settingsProvider)
 {
     if (settingsProvider == null)
     {
         throw new InvalidOperationException("P4Options.Save called without a settings provider.");
     }
     Save("UseP4Config", UseP4Config.ToString(), settingsProvider);
     Save("Server", Server, settingsProvider);
     Save("User", User, settingsProvider);
     Save("Password", Password, settingsProvider);
     Save("Workspace", Workspace, settingsProvider);
     Save("LogLevel", LogLevel.ToString(), settingsProvider);
     Save("IsCheckoutEnabled", IsCheckoutEnabled.ToString(), settingsProvider);
     Save("IsAddEnabled", IsAddEnabled.ToString(), settingsProvider);
     Save("IsRevertIfUnchangedEnabled", IsRevertIfUnchangedEnabled.ToString(), settingsProvider);
     Save("IsRevertEnabled", IsRevertEnabled.ToString(), settingsProvider);
     Save("PromptBeforeRevert", PromptBeforeRevert.ToString(), settingsProvider);
     Save("IsGetLatestRevisionEnabled", IsGetLatestRevisionEnabled.ToString(), settingsProvider);
     Save("IsViewRevisionHistoryEnabled", IsViewRevisionHistoryEnabled.ToString(), settingsProvider);
     Save("IsViewDiffEnabled", IsViewDiffEnabled.ToString(), settingsProvider);
     Save("IsViewTimeLapseEnabled", IsViewTimeLapseEnabled.ToString(), settingsProvider);
     Save("AutoCheckoutOnEdit", AutoCheckoutOnEdit.ToString(), settingsProvider);
     Save("AutoCheckoutOnSave", AutoCheckoutOnSave.ToString(), settingsProvider);
     Save("AutoAdd", AutoAdd.ToString(), settingsProvider);
     Save("AutoDelete", AutoDelete.ToString(), settingsProvider);
 }
Beispiel #3
0
        /// <summary>
        /// Save all options. (Persist between sessions.)
        /// </summary>
        public void Save(EnvDTE80.DTE2 dte2)
        {
            if (dte2 == null)
            {
                return;
            }

            Globals globals = dte2.Globals;

            Save("UseP4Config", UseP4Config.ToString(), globals);
            Save("Server", Server, globals);
            Save("User", User, globals);
            Save("Password", Password, globals);
            Save("Workspace", Workspace, globals);
            Save("LogLevel", LogLevel.ToString(), globals);
            Save("IsCheckoutEnabled", IsCheckoutEnabled.ToString(), globals);
            Save("IsAddEnabled", IsAddEnabled.ToString(), globals);
            Save("IsRevertIfUnchangedEnabled", IsRevertIfUnchangedEnabled.ToString(), globals);
            Save("IsRevertEnabled", IsRevertEnabled.ToString(), globals);
            Save("PromptBeforeRevert", PromptBeforeRevert.ToString(), globals);
            Save("IsGetLatestRevisionEnabled", IsGetLatestRevisionEnabled.ToString(), globals);
            Save("IsViewRevisionHistoryEnabled", IsViewRevisionHistoryEnabled.ToString(), globals);
            Save("IsViewDiffEnabled", IsViewDiffEnabled.ToString(), globals);
            Save("IsViewTimeLapseEnabled", IsViewTimeLapseEnabled.ToString(), globals);
            Save("AutoCheckoutOnEdit", AutoCheckoutOnEdit.ToString(), globals);
            Save("AutoCheckoutOnSave", AutoCheckoutOnSave.ToString(), globals);
            Save("AutoAdd", AutoAdd.ToString(), globals);
            Save("AutoDelete", AutoDelete.ToString(), globals);
        }