/// <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();
}