protected virtual IRecordInterface CopyFromImpl()

in messages/csharp/src/Deltix.Timebase.Messages/EPAM.Deltix.Timebase.Messages.Schema/SchemaDescriptorChangeAction.cs [381:458]


        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;
        }