protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save settings data.SetBooleanValue(SettingNames.EnableSystemSettingsSwitch, this.EnableSystemSettingsSwitch, omitDefault, this.EnableSystemSettingsSwitch == Defaults.EnableSystemSettingsSwitch); data.SetObjectValue(SettingNames.ActualProxy, this.ActualProxy, true, omitDefault, this.ActualProxy == null); return; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save settings data.SetBooleanValue(SettingNames.Start, this.Start, omitDefault, this.Start == Defaults.Start); data.SetInt32Value(SettingNames.ResumeTryCount, this.ResumeTryCount, omitDefault, this.ResumeTryCount == Defaults.ResumeTryCount); data.SetInt32Value(SettingNames.ResumeDelay, this.ResumeDelay, omitDefault, this.ResumeDelay == Defaults.ResumeDelay); data.SetInt32Value(SettingNames.ResumeInterval, this.ResumeInterval, omitDefault, this.ResumeInterval == Defaults.ResumeInterval); return; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save settings data.SetStringValue(SettingNames.EndPoint, this.EndPoint, omitDefault, Defaults.IsDefaultEndPoint(this.EndPoint)); data.SetStringValue(SettingNames.UserName, this.UserName, omitDefault, Defaults.IsDefaultUserName(this.UserName)); data.SetValue(SettingNames.ProtectedPassword, this.Password, CreatePasswordValue, omitDefault, Defaults.IsDefaultPassword(this.Password)); data.SetEnumValue(SettingNames.Persistence, this.Persistence, omitDefault, this.Persistence == Defaults.Persistence); data.SetBooleanValue(SettingNames.EnableAssumptionMode, this.EnableAssumptionMode, omitDefault, this.EnableAssumptionMode == Defaults.EnableAssumptionMode); return; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save settings data.SetStringValue(SettingNames.AutoConfigURL, this.AutoConfigURL); data.SetValue(SettingNames.ProxyEnable, this.ProxyEnable, ObjectDataExtension.CreateInt32Value); data.SetStringValue(SettingNames.ProxyServer, this.ProxyServer); data.SetStringValue(SettingNames.ProxyOverride, this.ProxyOverride); data.SetBooleanValue(SettingNames.AutoDetect, this.AutoDetect); data.SetStringValue(SettingNames.HttpProxyEnvironmentVariable, this.HttpProxyEnvironmentVariable); data.SetStringValue(SettingNames.HttpsProxyEnvironmentVariable, this.HttpsProxyEnvironmentVariable); return; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // state checks Debug.Assert(this.MainWindow != null); // save the base class level settings base.SaveTo(data, omitDefault); // save this class level settings data.SetBooleanValue(SettingNames.ChaseLastLog, this.ChaseLastLog, omitDefault, this.ChaseLastLog == Defaults.ChaseLastLog); data.SetObjectValue(SettingNames.MainWindow, this.MainWindow, true, omitDefault, false); // overwrite existing settings, not omittable return; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save settings data.SetInt32Value(SettingNames.InitialSetupLevel, this.InitialSetupLevel, omitDefault, this.InitialSetupLevel == Defaults.InitialSetupLevel); data.SetEnumValue(SettingNames.LogLevel, this.LogLevel, omitDefault, this.LogLevel == Defaults.LogLevel); data.SetValue(SettingNames.Culture, this.Culture, CreateCultureInfoValue, omitDefault, Defaults.IsDefaultCulture(this.Culture)); data.SetBooleanValue(SettingNames.NoLogo, this.NoLogo, omitDefault, this.NoLogo == Defaults.NoLogo); // Credentials: Note that only persistent credentials are saved. IEnumerable <CredentialSettings> persistentCredentials = GetPersistentCredentials(); data.SetObjectArrayValue(SettingNames.Credentials, persistentCredentials, omitDefault, Defaults.IsDefaultCredentials(persistentCredentials)); // SystemSettingsSwitcher: overwrite mode, not omittable (that is, isDefault should be false) data.SetObjectValue(SettingNames.SystemSettingsSwitcher, this.SystemSettingsSwitcher, true, omitDefault, false); // Proxy: replace mode, not omittable (that is, isDefault should be false) data.SetObjectValue(SettingNames.Proxy, this.Proxy, false, omitDefault, false); // GUI: overwrite mode, not omittable (that is, isDefault should be false) data.SetObjectValue(SettingNames.GUI, this.GUI, true, omitDefault, false); return; }