示例#1
0
 private void NodeGraphPanel_NodeCollectionModified(object sender, EC.NodeCollectionModifiedEventArgs e)
 {
     if (e.Action == NodeEditorLib.EditorControl.NodeCollectionModifiedEventArgs.ActionType.Removed)
     {
         var node = ((GraphNode)e.Item).Node;
         Graph.RemoveNode(node);
         node.Dispose();
     }
 }
示例#2
0
 private void _screen_NodeCollectionModified(object sender, NodeCollectionModifiedEventArgs e)
 {
     if (e.Action == NodeCollectionModifiedEventArgs.ActionType.Removed)
     {
         foreach (var port in e.Item.InputPorts.ToArray())
         {
             ClearConnections(port);
         }
         foreach (var port in e.Item.OutputPorts.ToArray())
         {
             ClearConnections(port);
         }
     }
     NodeCollectionModified?.Invoke(this, e);
 }