protected override IRecordInterface CopyFromImpl()

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


        protected override IRecordInterface CopyFromImpl(IRecordInfo source)
        {
            base.CopyFromImpl(source);
            if (typeof(ISchemaChangeMessageInfo).IsInstanceOfType(source))
            {
                ISchemaChangeMessageInfo typedSource = ((ISchemaChangeMessageInfo)(source));
                if ((typedSource.PreviousState != null))
                {
                    this.PreviousState = new List<IClassDescriptorInterface>(typedSource.PreviousState.Count);
                    int i;
                    for (i = 0; (i < typedSource.PreviousState.Count); i = (i + 1))
                    {
                        IClassDescriptorInfo item = typedSource.PreviousState[i];
                        if ((item == null))
                        {
                            this.PreviousState.Add(null);
                        }
                        else
                        {
                            this.PreviousState.Add(((IClassDescriptorInterface)(item.Clone())));
                        }
                    }
                }
                else
                {
                    this.PreviousState = null;
                }
                if ((typedSource.NewState != null))
                {
                    this.NewState = new List<IClassDescriptorInterface>(typedSource.NewState.Count);
                    int i;
                    for (i = 0; (i < typedSource.NewState.Count); i = (i + 1))
                    {
                        IClassDescriptorInfo item = typedSource.NewState[i];
                        if ((item == null))
                        {
                            this.NewState.Add(null);
                        }
                        else
                        {
                            this.NewState.Add(((IClassDescriptorInterface)(item.Clone())));
                        }
                    }
                }
                else
                {
                    this.NewState = null;
                }
                if ((typedSource.DescriptorChangeActions != null))
                {
                    this.DescriptorChangeActions = new List<ISchemaDescriptorChangeActionInterface>(typedSource.DescriptorChangeActions.Count);
                    int i;
                    for (i = 0; (i < typedSource.DescriptorChangeActions.Count); i = (i + 1))
                    {
                        ISchemaDescriptorChangeActionInfo item = typedSource.DescriptorChangeActions[i];
                        if ((item == null))
                        {
                            this.DescriptorChangeActions.Add(null);
                        }
                        else
                        {
                            this.DescriptorChangeActions.Add(((ISchemaDescriptorChangeActionInterface)(item.Clone())));
                        }
                    }
                }
                else
                {
                    this.DescriptorChangeActions = null;
                }
                this.Version = typedSource.Version;
            }
            return this;
        }