/// <summary> /// Create an new instance of the record information /// </summary> /// <returns>Deep copy of the RecordInfo class</returns> public object Clone() { var res = new VisynRecordInfo { CommentAnyPlace = CommentAnyPlace, CommentMarker = CommentMarker, IgnoreEmptyLines = IgnoreEmptyLines, IgnoreEmptySpaces = IgnoreEmptySpaces, IgnoreFirst = IgnoreFirst, IgnoreLast = IgnoreLast, NotifyRead = NotifyRead, NotifyWrite = NotifyWrite, RecordCondition = RecordCondition, RecordConditionRegEx = RecordConditionRegEx, RecordConditionSelector = RecordConditionSelector, RecordType = RecordType, SizeHint = SizeHint, }; res.Operations = Operations.Clone(res); res.Fields = new FieldBase[Fields.Length]; for (var i = 0; i < Fields.Length; i++) { res.Fields[i] = (FieldBase)((ICloneable)Fields[i]).Clone(); } return(res); }
/// <summary> /// Copy one object to another based on field list /// </summary> /// <param name="ri">Record layout instance</param> /// <returns>Copy of the handlers class is using</returns> public RecordOperations Clone(VisynRecordInfo ri) { return(new RecordOperations(ri) { mCreateHandler = mCreateHandler, mFastConstructor = mFastConstructor, mObjectToValuesHandler = mObjectToValuesHandler }); }