Exemplo n.º 1
0
        public bool Disconnect(IEdge edge)
        {
            bool success = this.RemoveEdge(edge);

            success = success && edge.GetOtherNode(this).RemoveEdge(edge);

            return(success);
        }
Exemplo n.º 2
0
        public IEdge ConnectTo(INode otherNode, IEdge edge)
        {
            if (edge.GetOtherNode(this) != otherNode)
            {
                logger.Error("Other node is not valid when connecting to it.");
                throw new InvalidNodeException(otherNode);
            }

            // add edge to nodes
            this.AddEdge(edge);
            otherNode.AddEdge(edge);

            return(edge);
        }