コード例 #1
0
 /// <summary>
 /// Deep copies content from src instance to this.
 /// <param name="source">Source for copy.</param>
 /// <returns>this.</returns>
 /// </summary>
 protected virtual IRecordInterface CopyFromImpl(IRecordInfo source)
 {
     if (typeof(ISchemaFieldChangeActionInfo).IsInstanceOfType(source))
     {
         ISchemaFieldChangeActionInfo typedSource = ((ISchemaFieldChangeActionInfo)(source));
         if ((typedSource.PreviousState != null))
         {
             if (((this.PreviousState == null) ||
                  (this.PreviousState.GetType() == typedSource.PreviousState.GetType())))
             {
                 this.PreviousState = ((DataField)(typedSource.PreviousState.Clone()));
             }
             else
             {
                 this.PreviousState.CopyFrom(typedSource.PreviousState);
             }
         }
         else
         {
             this.PreviousState = null;
         }
         if ((typedSource.NewState != null))
         {
             if (((this.NewState == null) ||
                  (this.NewState.GetType() == typedSource.NewState.GetType())))
             {
                 this.NewState = ((DataField)(typedSource.NewState.Clone()));
             }
             else
             {
                 this.NewState.CopyFrom(typedSource.NewState);
             }
         }
         else
         {
             this.NewState = null;
         }
         this.ChangeTypes = typedSource.ChangeTypes;
         if ((typedSource.DataTransformation != null))
         {
             if (((this.DataTransformation == null) ||
                  (this.DataTransformation.GetType() == typedSource.DataTransformation.GetType())))
             {
                 this.DataTransformation = ((SchemaFieldDataTransformation)(typedSource.DataTransformation.Clone()));
             }
             else
             {
                 this.DataTransformation.CopyFrom(typedSource.DataTransformation);
             }
         }
         else
         {
             this.DataTransformation = null;
         }
     }
     return(this);
 }
コード例 #2
0
 /// <summary>
 /// Deep copies content from src instance to this.
 /// <param name="source">Source for copy.</param>
 /// <returns>this.</returns>
 /// </summary>
 protected virtual IRecordInterface CopyFromImpl(IRecordInfo source)
 {
     if (typeof(ISchemaDescriptorChangeActionInfo).IsInstanceOfType(source))
     {
         ISchemaDescriptorChangeActionInfo typedSource = ((ISchemaDescriptorChangeActionInfo)(source));
         if ((typedSource.PreviousState != null))
         {
             if (((this.PreviousState == null) ||
                  (this.PreviousState.GetType() == typedSource.PreviousState.GetType())))
             {
                 this.PreviousState = ((ClassDescriptor)(typedSource.PreviousState.Clone()));
             }
             else
             {
                 this.PreviousState.CopyFrom(typedSource.PreviousState);
             }
         }
         else
         {
             this.PreviousState = null;
         }
         if ((typedSource.NewState != null))
         {
             if (((this.NewState == null) ||
                  (this.NewState.GetType() == typedSource.NewState.GetType())))
             {
                 this.NewState = ((ClassDescriptor)(typedSource.NewState.Clone()));
             }
             else
             {
                 this.NewState.CopyFrom(typedSource.NewState);
             }
         }
         else
         {
             this.NewState = null;
         }
         this.ChangeTypes = typedSource.ChangeTypes;
         if ((typedSource.DescriptorTransformation != null))
         {
             if (((this.DescriptorTransformation == null) ||
                  (this.DescriptorTransformation.GetType() == typedSource.DescriptorTransformation.GetType())))
             {
                 this.DescriptorTransformation = ((SchemaDescriptorTransformation)(typedSource.DescriptorTransformation.Clone()));
             }
             else
             {
                 this.DescriptorTransformation.CopyFrom(typedSource.DescriptorTransformation);
             }
         }
         else
         {
             this.DescriptorTransformation = null;
         }
         if ((typedSource.FieldChangeActions != null))
         {
             this.FieldChangeActions = new List <ISchemaFieldChangeActionInterface>(typedSource.FieldChangeActions.Count);
             int i;
             for (i = 0; (i < typedSource.FieldChangeActions.Count); i = (i + 1))
             {
                 ISchemaFieldChangeActionInfo item = typedSource.FieldChangeActions[i];
                 if ((item == null))
                 {
                     this.FieldChangeActions.Add(null);
                 }
                 else
                 {
                     this.FieldChangeActions.Add(((ISchemaFieldChangeActionInterface)(item.Clone())));
                 }
             }
         }
         else
         {
             this.FieldChangeActions = null;
         }
     }
     return(this);
 }