public void ConnectionDragCompleted(MessagePathViewModel newConnection, EntryViewModel connectorDraggedOut, EntryViewModel connectorDraggedOver)
        {
            if (connectorDraggedOver == null)
            {
                this.Network.Connections.Remove(newConnection);
                return;
            }
            var connectionOk = connectorDraggedOut.ParentNode != connectorDraggedOver.ParentNode &&
                               connectorDraggedOut.Type != connectorDraggedOver.Type;

            if (!connectionOk)
            {
                this.Network.Connections.Remove(newConnection);
                return;
            }
            var existingConnection = FindConnection(connectorDraggedOut, connectorDraggedOver);

            if (existingConnection != null)
            {
                this.Network.Connections.Remove(existingConnection);
            }
            if (newConnection.DestConnector == null)
            {
                newConnection.DestConnector = connectorDraggedOver;
            }
            else
            {
                newConnection.SourceConnector = connectorDraggedOver;
            }
        }
 public void ConnectionDragging(Point curDragPoint, MessagePathViewModel connection)
 {
     if (connection.DestConnector == null)
     {
         connection.DestConnectorHotspot = curDragPoint;
     }
     else
     {
         connection.SourceConnectorHotspot = curDragPoint;
     }
 }
        public MessagePathViewModel ConnectionDragStarted(EntryViewModel draggedOutConnector, Point curDragPoint)
        {
            var connection = new MessagePathViewModel();

            if (draggedOutConnector.Type == EntryType.Message)
            {
                connection.SourceConnector      = draggedOutConnector;
                connection.DestConnectorHotspot = curDragPoint;
            }
            else
            {
                connection.DestConnector          = draggedOutConnector;
                connection.SourceConnectorHotspot = curDragPoint;
            }
            this.Network.Connections.Add(connection);

            return(connection);
        }
 public void DeleteConnection(MessagePathViewModel connection)
 {
     this.Network.Connections.Remove(connection);
 }