예제 #1
0
        /// <inheritdoc />
        public void Clear()
        {
            IVertexEdgeDictionary <TVertex, TEdge> vertexEdges = _vertexEdges;

            _vertexEdges = new VertexEdgeDictionary <TVertex, TEdge>();
            EdgeCount    = 0;

            NotifyEdgesRemoved(vertexEdges.SelectMany(edges => edges.Value).Distinct());
            NotifyVerticesRemoved(vertexEdges.Keys);
            vertexEdges.Clear();
        }
예제 #2
0
        /// <inheritdoc />
        public void Clear()
        {
            IList <TEdge> edges = _edges;

            _edges = new List <TEdge>();
            IVertexEdgeDictionary <TVertex, TEdge> adjacentEdges = _adjacentEdges;

            _adjacentEdges = new VertexEdgeDictionary <TVertex, TEdge>();
            EdgeCount      = 0;

            NotifyEdgesRemoved(edges);
            NotifyVerticesRemoved(adjacentEdges.Keys);
            edges.Clear();
            adjacentEdges.Clear();
        }
예제 #3
0
        /// <inheritdoc />
        public void Clear()
        {
            if (EdgeRemoved != null) // Lazily notify
            {
                foreach (TEdge edge in _vertexEdges.SelectMany(edges => edges.Value).Distinct())
                {
                    OnEdgeRemoved(edge);
                }
                foreach (TVertex vertex in _vertexEdges.Keys)
                {
                    OnVertexRemoved(vertex);
                }
            }

            _vertexEdges.Clear();
            EdgeCount = 0;
        }
        /// <inheritdoc />
        public void Clear()
        {
            if (EdgeRemoved != null) // Lazily notify
            {
                foreach (TEdge edge in _edges)
                {
                    OnEdgeRemoved(edge);
                }
                foreach (TVertex vertex in _adjacentEdges.Keys)
                {
                    OnVertexRemoved(vertex);
                }
            }

            _edges.Clear();
            _adjacentEdges.Clear();
            EdgeCount = 0;
        }
예제 #5
0
 /// <inheritdoc />
 public void Clear()
 {
     _vertexOutEdges.Clear();
     _vertexInEdges.Clear();
     EdgeCount = 0;
 }
예제 #6
0
 /// <inheritdoc />
 public void Clear()
 {
     _vertexEdges.Clear();
     EdgeCount = 0;
 }