Example #1
0
        public void Remove(ConnectionInfo connection)
        {
            string key = GetKey(connection);

            connections.Remove(key);
            metadataProviders.Remove(connection);
            var e = new ConnectionsEventArgs(connection);

            ConnectionRemoved?.Invoke(this, e);
        }
        public void RemoveConnection(IStudioConnection connection)
        {
            if (!_connections.Contains(connection))
            {
                return;
            }

            connection.SetTargetState(Shared.ConnectionState.Destroyed);

            _connections.Remove(connection);
            ConnectionRemoved?.Invoke(this, connection);
        }
Example #3
0
        public virtual void RemoveConnection(InputPort port)
        {
            if (port == null)
            {
                throw new ArgumentNullException();
            }

            if (_connections.Contains(port))
            {
                _connections.Remove(port);
                ConnectionRemoved?.Invoke(this, new ConnectionModifiedEventArgs(ConnectionModifiedEventArgs.Modifier.Removed, port));
            }
            else
            {
                throw new ArgumentException("element not found", nameof(port));
            }
        }
Example #4
0
        public void HandleBpmnElementEvent(BpmnElementEvent e)
        {
            TranslateProcessId(e);
            switch (e.Type)
            {
            case BpmnConstants.BPMN_EVENT_CLICK:
                ElementClick?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_ELEMENT_CHANGED:
                ElementChanged?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_SHAPE_ADDED:
                ShapeAdded?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_SHAPE_REMOVED:
                ShapeRemoved?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_UPDATE_ID:
                ElementIdUpdated?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_CONNECTION_REMOVED:
                ConnectionRemoved?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_CONNECTION_ADDED:
                ConnectionAdded?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_ROOT_ADDED:
                RootAdded?.Invoke(this, e);
                break;

            case BpmnConstants.BPMN_EVENT_ROOT_REMOVED:
                RootRemoved?.Invoke(this, e);
                break;
            }
        }
Example #5
0
        public void HandleBpmnElementEvent(BpmnElementEvent e)
        {
            switch (e.Type)
            {
            case "element.click":
                ElementClick?.Invoke(this, e);
                break;

            case "element.changed":
                ElementChanged?.Invoke(this, e);
                break;

            case "shape.added":
                ShapeAdded?.Invoke(this, e);
                break;

            case "shape.removed":
                ShapeRemoved?.Invoke(this, e);
                break;

            case "element.updateId":
                ElementIdUpdated?.Invoke(this, e);
                break;

            case "connection.removed":
                ConnectionRemoved?.Invoke(this, e);
                break;

            case "connection.added":
                ConnectionAdded?.Invoke(this, e);
                break;

            case "root.added":
                RootAdded?.Invoke(this, e);
                break;

            case "root.removed":
                RootRemoved?.Invoke(this, e);
                break;
            }
        }
Example #6
0
        private void RemoveSubdividedConnection(NodeConnection connection)
        {
            var eitherNodeDoesntExistInLayout = !Nodes.ContainsKey(connection.Start) || !Nodes.ContainsKey(connection.End);

            if (eitherNodeDoesntExistInLayout)
            {
                return;
            }

            var node1 = Nodes[connection.Start];
            var node2 = Nodes[connection.End];

            if (!AreConnected(node1, node2))
            {
                return;
            }

            RemoveOneWayConnection(node1, node2);
            RemoveOneWayConnection(node2, node1);

            ConnectionRemoved.CallEvent(connection);
        }
Example #7
0
 /// <summary>
 /// Invokes ConnectionRemoved event.
 /// </summary>
 /// <param name="remoteId">The remote ID of the removed connection</param>
 protected virtual void OnConnectionRemoved(Guid remoteId)
 {
     ConnectionRemoved?.Invoke(this, new ConnectionRemovedEventArgs(remoteId));
 }
Example #8
0
 /// <summary>
 /// Invokes ConnectionRemoved event.
 /// </summary>
 protected virtual void OnConnectionRemoved(ConnectionRemovedEventArgs e)
 {
     ConnectionRemoved?.Invoke(this, e);
 }