Click or drag to resize

SubGraphViewTVertex, TEdge Class

Class which represents a subgraph view on a main graph with a subset of the vertices/edges of the main graph.
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.GraphsSubGraphViewTVertex, TEdge
    SD.LLBLGen.Pro.ApplicationCore.EntityModelInheritanceHierarchyView
    SD.LLBLGen.Pro.ApplicationCore.EntityModel.ModelViewsModelView

Namespace:  SD.Tools.Algorithmia.Graphs
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.4.0.0 (1.4.19.0711)
Syntax
public class SubGraphView<TVertex, TEdge> : IDisposable, 
	INotifyAsRemoved
where TEdge : class, Object, IEdge<TVertex>

Type Parameters

TVertex
The type of the vertices in this graph.
TEdge
The type of the edges in the graph

The SubGraphViewTVertex, TEdge type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyEdges
Gets the edges contained in this SubGraphView. All edges are part of this.MainGraph. All vertices are part of this.MainGraph. Enumerating this property will enumerate the inner structures of the SubGraphView, no copy is made. This requires a lock on this.MainGraph.SyncRoot if this.MainGraph.IsSynchronized is set to true to make sure enumeration of this property is thread safe.
Public propertyMainGraph
Gets the main graph this SubGraphView is a view on
Public propertyVertices
Gets the vertices contained in this SubGraphView. All vertices are part of this.MainGraph. Enumerating this property will enumerate the inner structures of the SubGraphView, no copy is made. This requires a lock on this.MainGraph.SyncRoot if this.MainGraph.IsSynchronized is set to true to make sure enumeration of this property is thread safe.
Top
Methods
  NameDescription
Public methodAdd(TEdge)
Adds the specified edge. If the vertices aren't in the view, they're added too.
Public methodAdd(TVertex)
Adds the specified vertex.
Public methodBindEvents
Binds the event handlers to the events of the main graph.
Public methodContains(TEdge)
Determines whether this SubGraphView contains the passed in edge.
Public methodContains(TVertex)
Determines whether this SubGraphView contains the passed in vertex.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandleEdgeAddedToMainGraph
Handles the event that a new edge was added to the main graph
Protected methodHandleEdgeRemovedFromMainGraph
Handles the event that an edge was removed from the main graph.
Protected methodHandleVertexAddedToMainGraph
Handles the event that a new vertex was added to the main graph.
Protected methodHandleVertexRemovedFromMainGraph
Handles the event that a vertex was removed from the main graph.
Public methodMarkAsRemoved
Marks this instance as removed. It raises ElementRemoved
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDisposing
Called when Disposing
Protected methodOnEdgeAdded
Called when an edge has been added to this view
Protected methodOnEdgeRemoved
Called when an edge has been removed from this view
Protected methodOnVertexAdded
Called when a vertex has been added to this view
Protected methodOnVertexRemoved
Called when a vertex has been removed from this view
Protected methodPerformSyncedAction(Action)
Performs the specified action, either inside a lock on MainGraph.SyncRoot if thegraph is Synchronized, or normally, if the graph isn't synchronized.
Protected methodPerformSyncedActionT(FuncT)
Performs the specified action, either inside a lock on MainGraph.SyncRoot if the graph is Synchronized, or normally, if the graph isn't synchronized.
Public methodRemove(TEdge)
Removes the edge.
Public methodRemove(TVertex)
Removes the vertex.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnbindEvents
Unbinds the event handlers from the events of the main graph.
Top
Events
  NameDescription
Public eventDisposed
Event which is raised when this instance was disposed.
Public eventEdgeAdded
Event which is raised when an edge has been added to this SubGraphView
Public eventEdgeChanged
If TEdge supports change notification, this event is raised when an edge in the subgraph view was changed
Public eventEdgeRemoved
Event which is raised when an edge has been removed from this SubGraphView
Public eventHasBeenRemoved
Raised when the implementing element has been removed from its container
Public eventIsEmpty
Event which is raised when the subgraphview is made empty. Observers can use this event to dispose an empty subgraphview to avoid dangling event handlers.
Public eventVertexAdded
Event which is raised when a vertex has been added to this SubGraphView
Public eventVertexChanged
If TVertex supports change notification, this event is raised when a vertex in the subgraph view was changed
Public eventVertexRemoved
Event which is raised when a vertex has been removed from this SubGraphView
Top
Remarks
SubGraphView instances are used to 'view' a subset of a bigger graph and maintain themselves based on the actions on the main graph. Adding/removing vertices / edges from this SubGraphView removes them only from this view, not from the main graph. Adding vertices/edges to the main graph will add the vertex/edge to this view if the added element meets criteria (implemented through polymorphism, by default no criteria are set, so no vertex/edge is added if it's added to the main graph). Removing a vertex/edge from the main graph will remove the vertex / edge from this view if it's part of this view. As this view binds to events on the main graph, it's key to call Dispose() on an instance of SubGraphView if it's no longer needed to make sure event handlers are cleaned up. This view has no adjacency lists, as they're located in the main graph.

If the graph specified is a synchronized graph, this view is also synchronized, and will sync its actions with the graph using the graph's SyncRoot object.
See Also