예제 #1
0
        public void DisconnectView(BaseConnectionView edgeView)
        {
            BasePortView inputPortView = edgeView.input as BasePortView;
            BaseNodeView inputNodeView = inputPortView.node as BaseNodeView;

            if (inputPortView != null)
            {
                inputPortView.Disconnect(edgeView);
            }
            inputPortView.Disconnect(edgeView);

            BasePortView outputPortView = edgeView.output as BasePortView;
            BaseNodeView outputNodeView = outputPortView.node as BaseNodeView;

            if (outputPortView != null)
            {
                outputPortView.Disconnect(edgeView);
            }
            outputPortView.Disconnect(edgeView);

            inputNodeView.RefreshPorts();
            outputNodeView.RefreshPorts();

            RemoveElement(edgeView);
        }
예제 #2
0
 public virtual void Disconnect(BaseConnectionView connection)
 {
     base.Disconnect(connection);
     if (connection is BaseConnectionView connectionView)
     {
         ConnectionViews.Remove(connectionView.Model);
     }
 }
예제 #3
0
 public virtual void Connect(BaseConnectionView connection)
 {
     base.Connect(connection);
     if (connection is BaseConnectionView connectionView)
     {
         ConnectionViews[connectionView.Model] = connectionView;
     }
 }