protected override void PortConnectedHandler(PortModel arg1, ConnectorModel arg2)
 {
     UpdateUpstream();
 }
Beispiel #2
0
 /// <summary>
 /// Called when a port is connected.
 /// </summary>
 /// <param name="connector"></param>
 protected virtual void OnPortConnected(ConnectorModel connector)
 {
     if (Owner != null)
         Owner.RaisePortConnectedEvent(this, connector);
 }
Beispiel #3
0
        internal void Connect(ConnectorModel connector)
        {
            connectors.Add(connector);

            //throw the event for a connection
            OnPortConnected(connector);

            IsConnected = true;
        }
Beispiel #4
0
        internal void Disconnect(ConnectorModel connector, bool silent = false)
        {
            if (!connectors.Contains(connector))
                return;

            //throw the event for a disconnection
            if (!silent)
            {
                OnPortDisconnected();
            }

            connectors.Remove(connector);

            if (connectors.Count == 0)
            {
                IsConnected = false;
            }

            Owner.ValidateConnections();
        }
Beispiel #5
0
 /// <summary>
 /// Called when a port is connected.
 /// </summary>
 /// <param name="connector"></param>
 protected virtual void OnPortConnected(ConnectorModel connector)
 {
     if (PortConnected != null)
         PortConnected(this, connector);
 }