private void pastePropertiesToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_clipboardProperties == null)
return;
foreach (TreeNode tn in multiSelectTreeviewElementsGroups.SelectedNodes) {
ElementNode element = tn.Tag as ElementNode;
foreach (IPropertyModuleInstance sourceProperty in _clipboardProperties) {
IPropertyModuleInstance destinationProperty;
if (element.Properties.Contains(sourceProperty.Descriptor.TypeId)) {
destinationProperty = element.Properties.Get(sourceProperty.Descriptor.TypeId);
} else {
destinationProperty = element.Properties.Add(sourceProperty.Descriptor.TypeId);
}
if (destinationProperty == null) {
VixenSystem.Logging.Error("ConfigElements: pasting a property to a element, but can't make or find the instance!");
continue;
}
// get the property to do its best to copy values from the property we're copying from.
destinationProperty.CloneValues(sourceProperty);
}
}
PopulateFormWithNode(_displayedNode, true);
}