private static void SaveWINDOWPLACEMENT(NativeMethods.WINDOWPLACEMENT value, IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // save WINDOWPLACEMENT value // there values are not omitted data.SetInt32Value(SettingNames.Flags, value.Flags); data.SetInt32Value(SettingNames.ShowCmd, value.ShowCmd); data.SetObjectValue(SettingNames.MinPosition, value.MinPosition, SavePOINT); data.SetObjectValue(SettingNames.MaxPosition, value.MaxPosition, SavePOINT); data.SetObjectValue(SettingNames.NormalPosition, value.NormalPosition, SaveRECT); return; }
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.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; }
protected override void SaveTo(IObjectData data, bool omitDefault) { // argument checks Debug.Assert(data != null); // state checks Debug.Assert(this.MainListener != null); // this.AdditionalListeners can be null Debug.Assert(0 < this.RetryCount); // save settings data.SetObjectValue(SettingNames.MainListener, this.MainListener, false, omitDefault, Defaults.IsDefaultMainListener(this.MainListener)); data.SetObjectArrayValue(SettingNames.AdditionalListeners, this.AdditionalListeners, omitDefault, Defaults.IsDefaultAdditionalListeners(this.AdditionalListeners)); data.SetInt32Value(SettingNames.RetryCount, this.RetryCount, omitDefault, this.RetryCount == Defaults.RetryCount); 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 SetValueAdapter(IObjectData data, string name, T value, bool omitDefault, bool isDefault) { data.SetObjectValue(name, value, this.Formatter, omitDefault, isDefault); }
protected override void SetValueAdapter(IObjectData data, string name, Tuple <T> value) { data.SetObjectValue(name, value, this.Formatter); }