public MVCSettings() { FileTypeExtension = FILE_TYPE_EXTENSION; FileTypeName = FILE_TYPE_NAME; FileTypeDescription = FILE_TYPE_DESCRIPTION; SerializeAs = SerializationFormat.Xml;//default SomeComponent = new MVCSettingsComponent(); }
public MVCSettings ( Int32 someInt, Boolean someBoolean, String someString, MVCSettingsComponent someComponent ) : this(someInt, someBoolean, someString) { SomeComponent = someComponent; }
/// <summary> /// Compare property values of two specified Settings objects. /// </summary> /// <param name="other"></param> /// <returns></returns> public override Boolean Equals(ISettingsComponent other) { Boolean returnValue = default(Boolean); MVCSettingsComponent otherModel = default(MVCSettingsComponent); try { otherModel = other as MVCSettingsComponent; if (this == otherModel) { returnValue = true; } else { if (!base.Equals(other)) { returnValue = false; } else if (this.SomeOtherInt != otherModel.SomeOtherInt) { returnValue = false; } else if (this.SomeOtherBoolean != otherModel.SomeOtherBoolean) { returnValue = false; } else if (this.SomeOtherString != otherModel.SomeOtherString) { returnValue = false; } else { returnValue = true; } } } catch (Exception ex) { Log.Write(ex, MethodBase.GetCurrentMethod(), EventLogEntryType.Error); throw; } return(returnValue); }
/// <summary> /// Copies property values from source working fields to detination working fields, then optionally syncs destination. /// </summary> /// <param name="destination"></param> /// <param name="sync"></param> public override void CopyTo(ISettingsComponent destination, Boolean sync) { MVCSettingsComponent destinationSettings = default(MVCSettingsComponent); try { destinationSettings = destination as MVCSettingsComponent; destinationSettings.SomeOtherInt = this.SomeOtherInt; destinationSettings.SomeOtherBoolean = this.SomeOtherBoolean; destinationSettings.SomeOtherString = this.SomeOtherString; base.CopyTo(destination, sync);//also checks and optionally performs sync } catch (Exception ex) { Log.Write(ex, MethodBase.GetCurrentMethod(), EventLogEntryType.Error); throw; } }