protected override IRecordInterface CopyFromImpl()

in messages/csharp/src/Deltix.Timebase.Messages/EPAM.Deltix.Timebase.Messages.Schema/RecordClassDescriptor.cs [305:366]


        protected override IRecordInterface CopyFromImpl(IRecordInfo source)
        {
            base.CopyFromImpl(source);
            if (typeof(IRecordClassDescriptorInfo).IsInstanceOfType(source))
            {
                IRecordClassDescriptorInfo typedSource = ((IRecordClassDescriptorInfo)(source));
                if ((typedSource.Parent != null))
                {
                    if (((this.Parent == null) 
                                || (this.Parent.GetType() == typedSource.Parent.GetType())))
                    {
                        this.Parent = ((RecordClassDescriptor)(typedSource.Parent.Clone()));
                    }
                    else
                    {
                        this.Parent.CopyFrom(typedSource.Parent);
                    }
                }
                else
                {
                    this.Parent = null;
                }
                if ((typedSource.HasIsAbstract() == true))
                {
                    this.IsAbstract = typedSource.IsAbstract;
                }
                else
                {
                    this.NullifyIsAbstract();
                }
                if ((typedSource.HasIsContentClass() == true))
                {
                    this.IsContentClass = typedSource.IsContentClass;
                }
                else
                {
                    this.NullifyIsContentClass();
                }
                if ((typedSource.DataFields != null))
                {
                    this.DataFields = new List<IDataFieldInterface>(typedSource.DataFields.Count);
                    int i;
                    for (i = 0; (i < typedSource.DataFields.Count); i = (i + 1))
                    {
                        IDataFieldInfo item = typedSource.DataFields[i];
                        if ((item == null))
                        {
                            this.DataFields.Add(null);
                        }
                        else
                        {
                            this.DataFields.Add(((IDataFieldInterface)(item.Clone())));
                        }
                    }
                }
                else
                {
                    this.DataFields = null;
                }
            }
            return this;
        }