CardMaker.XML.ProjectLayoutElement.DeepCopy C# (CSharp) Method

DeepCopy() public method

Performs a partial deepy copy based on the input element, the name field is left unchanged
public DeepCopy ( ProjectLayoutElement zElement, bool bInitializeCache ) : void
zElement ProjectLayoutElement The source element to copy from
bInitializeCache bool flag indicating whether to reinitialize the cache
return void
        public void DeepCopy(ProjectLayoutElement zElement, bool bInitializeCache)
        {
            verticalalign = zElement.verticalalign;
            horizontalalign = zElement.horizontalalign;
            x = zElement.x;
            y = zElement.y;
            width = zElement.width;
            height = zElement.height;
            borderthickness = zElement.borderthickness;
            outlinethickness = zElement.outlinethickness;
            outlinecolor = zElement.outlinecolor;
            rotation = zElement.rotation;
            bordercolor = zElement.bordercolor;
            font = zElement.font;
            elementcolor = zElement.elementcolor;
            type = zElement.type;
            autoscalefont = zElement.autoscalefont;
            lockaspect = zElement.lockaspect;
            keeporiginalsize = zElement.keeporiginalsize;
            variable = zElement.variable;
            opacity = zElement.opacity;
            enabled = zElement.enabled;
            lineheight = zElement.lineheight;
            wordspace = zElement.wordspace;

            if (bInitializeCache)
            {
                InitializeCache();
            }
        }

Usage Example

示例#1
0
        /// <summary>
        /// Performs a partial deepy copy based on the input element, the name field is left unchanged
        /// </summary>
        /// <param name="zLayout">The layout to copy from</param>
        /// <param name="bCopyRefs">Flag indicating whether to copy the refereces</param>
        public void DeepCopy(ProjectLayout zLayout, bool bCopyRefs = true)
        {
            width                       = zLayout.width;
            height                      = zLayout.height;
            defaultCount                = zLayout.defaultCount;
            dpi                         = zLayout.dpi;
            drawBorder                  = zLayout.drawBorder;
            buffer                      = zLayout.buffer;
            zoom                        = zLayout.zoom;
            exportCropDefinition        = zLayout.exportCropDefinition;
            combineReferences           = zLayout.combineReferences;
            exportNameFormat            = zLayout.exportNameFormat;
            exportRotation              = zLayout.exportRotation;
            exportWidth                 = zLayout.exportWidth;
            exportHeight                = zLayout.exportHeight;
            exportTransparentBackground = zLayout.exportTransparentBackground;
            if (null != zLayout.Element)
            {
                var listElements = new List <ProjectLayoutElement>();
                foreach (ProjectLayoutElement zElement in zLayout.Element)
                {
                    var zElementCopy = new ProjectLayoutElement(zElement.name);
                    zElementCopy.DeepCopy(zElement, true);
                    listElements.Add(zElementCopy);
                }
                Element = listElements.ToArray();
            }
            if (bCopyRefs && null != zLayout.Reference)
            {
                var listReferences = new List <ProjectLayoutReference>();
                foreach (var zReference in zLayout.Reference)
                {
                    var zReferenceCopy = new ProjectLayoutReference();
                    zReferenceCopy.DeepCopy(zReference);
                    listReferences.Add(zReferenceCopy);
                }
                Reference = listReferences.ToArray();
            }

            InitializeElementLookup();
        }
All Usage Examples Of CardMaker.XML.ProjectLayoutElement::DeepCopy