Exemplo n.º 1
0
        public override IGraphCloneable Clone(CloneContext cloneContext)
        {
            DxfGroup dxfGroup = (DxfGroup)cloneContext.GetExistingClone((IGraphCloneable)this);

            if (dxfGroup == null)
            {
                dxfGroup = new DxfGroup();
                cloneContext.RegisterClone((IGraphCloneable)this, (IGraphCloneable)dxfGroup);
                dxfGroup.CopyFrom((DxfHandledObject)this, cloneContext);
            }
            return((IGraphCloneable)dxfGroup);
        }
Exemplo n.º 2
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfGroup dxfGroup = (DxfGroup)from;

            this.string_0 = dxfGroup.string_0;
            this.string_1 = dxfGroup.string_1;
            this.bool_0   = dxfGroup.bool_0;
            this.dxfHandledObjectCollection_1.Clear();
            if (cloneContext.SourceModel == cloneContext.TargetModel)
            {
                this.dxfHandledObjectCollection_1.AddRange((IEnumerable <DxfHandledObject>)dxfGroup.dxfHandledObjectCollection_1);
            }
            else
            {
                foreach (DxfEntity dxfEntity in dxfGroup.dxfHandledObjectCollection_1)
                {
                    if (dxfEntity != null)
                    {
                        this.dxfHandledObjectCollection_1.Add((DxfHandledObject)dxfEntity.Clone(cloneContext));
                    }
                }
            }
        }