/// <summary> /// Copy a node config, used to allow external applications to create a suitable node /// </summary> /// <param name="node"></param> public static void CopyNode(BaseNodeConfig config) { SlaveLayerNodeConfig slaveConfig = config as SlaveLayerNodeConfig; if (slaveConfig != null) { // Copy the master, not slave config = slaveConfig.Master; } Clipboard.SetData(NODECONFIG_DATA, config); }
private void netEditor_NodeDeleted(object sender, NodeDeletedEventArgs e) { BaseNodeConfig config = e.Node.Tag as BaseNodeConfig; if (config != null) { config.Delete(); if (config is MasterLayerNodeConfig) { MasterLayerNodeConfig masterConfig = config as MasterLayerNodeConfig; DeleteByConfig(masterConfig.Slave); } else if (config is SlaveLayerNodeConfig) { SlaveLayerNodeConfig slaveConfig = config as SlaveLayerNodeConfig; DeleteByConfig(slaveConfig.Master); } } }