protected internal virtual void AddVertices(int sourceVertexPosition, int[] targetVertexPositions, EdgeNodeStateContextFactory <E> edgeFactory, VertexNodeStateContextFactory <V> vertexFactory) { lock (this.IncidenceProvider.Values) { var edgePositionList = this.IncidenceProvider.SetVertices(sourceVertexPosition, targetVertexPositions); lock (this.NodeStateContextContainerFacade) { edgePositionList.ForEach(t => this.NodeStateContextContainerFacade.AddEdge(t, edgeFactory)); } } lock (this.AdjacencyProvider.Values) { this.AdjacencyProvider.SetVertices(sourceVertexPosition, targetVertexPositions); lock (this.NodeStateContextContainerFacade) { NodeStateContextContainerFacade.AddVertex(sourceVertexPosition, vertexFactory); targetVertexPositions.ToList().ForEach(t => NodeStateContextContainerFacade.AddVertex(t, vertexFactory)); } } }
protected internal virtual void AddVertices(int sourceVertexPosition, int targetVertex, EdgeNodeStateContextFactory <E> edgeFactory, VertexNodeStateContextFactory <V> vertexFactory) { lock (this.IncidenceProvider.Values) { var edgePosition = this.IncidenceProvider.SetVertices(sourceVertexPosition, targetVertex); lock (this.NodeStateContextContainerFacade) { this.NodeStateContextContainerFacade.AddEdge(edgePosition, edgeFactory); } } lock (this.AdjacencyProvider.Values) { this.AdjacencyProvider.SetVertices(sourceVertexPosition, targetVertex); lock (this.NodeStateContextContainerFacade) { NodeStateContextContainerFacade.AddVertex(sourceVertexPosition, vertexFactory); NodeStateContextContainerFacade.AddVertex(targetVertex, vertexFactory); } } }