Graph Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a directed graph that consists of nodes and links.

Namespace:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

[SerializableAttribute]
public class Graph : GraphObject, ISerializable

The Graph type exposes the following members.

  NameDescription
Public methodGraph()Constructs a Graph object.
Protected methodGraph(SerializationInfo, StreamingContext)Special constructor that is used for deserialization only.
Top

  NameDescription
Public propertyAllGroupsEvery group in the graph regardless of visibility or nesting.
Public propertyAllSchemasReturns a list of all unique known schemas.
Public propertyCategoriesReturns all categories. Never returns null. (Inherited from GraphObject.)
Public propertyCategoryCountReturns the number of categories in the object. (Inherited from GraphObject.)
Public propertyStatic memberCommonPathsA dictionary of the common paths that are replaced during serialization.
Public propertyDescriptiveCategoryLabelCreates a delimited list of all category labels for this graph object. (Inherited from GraphObject.)
Public propertyDocumentSchemaThe serialized document schema for the graph. (Overrides GraphObject.DocumentSchema.)
Public propertyGroupsGets the collection of all top-level groups.
Public propertyIsGroupGets whether this object is IsGroup. It looks for the GraphProperties.StyleForGroup. (Inherited from GraphObject.)
Public propertyIsPseudoGets whether this object is Pseudo. It looks for the GraphProperties.IsPseudo. (Inherited from GraphObject.)
Public propertyItemProperty that gets or sets a property value. (Inherited from GraphObject.)
Public propertyLinksGets the collection of links.
Public propertyNodesGets the collection of nodes.
Public propertyOrphanNodesGets all nodes that are not children of any GraphGroup.
Public propertyOwnerGets the Graph object that this object belongs to. (Inherited from GraphObject.)
Public propertyPathsCommonPaths found by the serializer during load which we will also use during save.
Public propertyPropertiesProperty that returns an enumeration of all annotations. The order of the enumeration is random. (Inherited from GraphObject.)
Public propertyPropertyCountProperty that returns a number of all annotations. (Inherited from GraphObject.)
Public propertyPropertyKeysProperty that returns an enumeration of all annotation keys. The order of the enumeration is random. (Inherited from GraphObject.)
Public propertyPropertyValuesProperty that returns an enumeration of all annotation values. The order of the enumeration is random. (Inherited from GraphObject.)
Public propertyStylesGets the collection of styles.
Public propertyVisibilityHelper property to get/set visibility property of a GraphObject. (Inherited from GraphObject.)
Public propertyVisibleLinksReturns the visible links (link.IsVisible == true).
Public propertyVisibleNodesReturns the visible nodes (node.IsVisible == true).
Public propertyVisibleOrphanNodesGets all visible nodes that are not children of any GraphGroup.
Public propertyVisibleTopLevelGroupsReturns the visible top-level groups (node.IsVisible == true).
Top

  NameDescription
Public methodAddCategoryAdds a category to the object. (Inherited from GraphObject.)
Public methodAddSchemaAdds a new schema to the Graph. As soon as it is added, it cannot be removed again as nodes or links might be using categories or properties from the schema.
Public methodAsNodeConverts the GraphObject to a GraphNode. If this is a GraphGroup, the inner node is returned. For types other than GraphNode/Group, null is returned. (Inherited from GraphObject.)
Public methodBeginUpdate(Object, String, UndoOption)Starts a batch mode update on the Graph (which is more efficient). You must call the Complete() method on the returned GraphTransactionScope, otherwise your changes will be rolled back. The usual pattern is to use this in a using block so that if an exception is thrown the changes are automatically rolled back.
Public methodBeginUpdate(Object, String, UndoOption, Boolean)Starts a batch mode update on the Graph (which is more efficient). You must call the Complete() method on the returned GraphTransactionScope, otherwise your changes will be rolled back. The usual pattern is to use this in a using block so that if an exception is thrown the changes are automatically rolled back.
Public methodClear
Public methodClearCategoriesRemove all categories from this object. (Inherited from GraphObject.)
Public methodClearValue(GraphProperty)Removes the value of the specified property. (Inherited from GraphObject.)
Public methodCopyCreates a copy of this graph.
Public methodCopyCategoriesCopies any new categories from the given object, keeping existing categories. (Inherited from GraphObject.)
Public methodCopyPropertiesCopies any new properties from the given object, keeping existing property values unchanged. (Inherited from GraphObject.)
Public methodCopySchemasCopies the schemas from the other graph.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFindCommonAncestorFinds the common ancestor of all the nodes in the given collection.
Public methodFindGroupReturns the GraphGroup wrapper for the given "IsGroup" node.
Public methodStatic memberGetGroupDescendants(IEnumerable<GraphObject>)Gets a flat list of all the descendant nodes of the given list of graph objects where some of those objects could be groups.
Public methodStatic memberGetGroupDescendants(IEnumerable<GraphObject>, Predicate<GraphGroup>, Predicate<GraphNode>)Gets a flat list of all the descendant nodes of the given list of graph objects where some of those objects could be groups, filtered to include only the nodes and groups that match the given predicates.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetMetaObject (Inherited from GraphObject.)
Public methodGetObjectDataISerializable implementation. Gets the data for the object. Serialize the graph into DGML.
Protected methodGetSchemaValueGets the schema-specific value of the property, if one exists. (Inherited from GraphObject.)
Public methodStatic memberGetSearchableObjectsGets a flat list of all the nodes in the graph that are visible, in top-down DFS group hierarchy order.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValue(String)Gets the value of the specified property. (Inherited from GraphObject.)
Public methodGetValue(GraphProperty)Gets the value of the specified annotation. (Inherited from GraphObject.)
Public methodGetValue<T>(GraphProperty, Graph)Gets the value of the specified property. (Inherited from GraphObject.)
Public methodGetValue<T>(GraphProperty, T)Gets the value of the specified annotation. If property is not set, we return the default value that the caller passed to this method. (Inherited from GraphObject.)
Public methodGetValue<T>(GraphProperty, Graph, GraphCategory)Gets the value of the specified property, and also returns the category that this property value was inherited from, if any. (Inherited from GraphObject.)
Public methodGetValueAsStringReturns the given property as a string that uses the given culture. (Inherited from GraphObject.)
Public methodHasCategory(String)Returns true if the object has the given category. (Inherited from GraphObject.)
Public methodHasCategory(GraphCategory)Returns true if the object has the given category. (Inherited from GraphObject.)
Public methodHasCategory(IEnumerable<GraphCategory>)Returns true if the object has any of the given categories. (Inherited from GraphObject.)
Public methodHasCategoryInSetDetermines whether the given set of categories applies to this object. (Inherited from GraphObject.)
Public methodHasLocalValueReturns true if the specified property exists on this object with no category inheritance check. (Inherited from GraphObject.)
Public methodHasValue(String)Find out whether the object has a value for the specified property. (Inherited from GraphObject.)
Public methodHasValue(GraphProperty)Returns true if the specified annotation exists. (Inherited from GraphObject.)
Public methodHideOrphansHides orphan nodes. An orphan is a node that is not contained by a group.
Public methodImportLinkImports a Link together with its source and target nodes so that they belong to the graph also. Merges any node or link properties and categories necessary.
Public methodImportNodeImports a node into a graph, merging any categories and properties necessary.
Public methodImportStyleCreates a copy of the given style that belongs to this graph.
Public methodImportSubset(GraphNode, Boolean, Int32)Clones the given node and its properties and the given number of levels of links and all the nodes those links point to and imports all these new nodes and links into this graph. If levels is zero, no links are copied. If levels is 1, it copies one level of links and all the nodes they point to.
Public methodImportSubset(IEnumerable<GraphNode>, Boolean, Int32)Clones all the nodes and the given number of levels of links away from those nodes.
Public methodStatic memberLoad(Stream, GraphSchema[])Loads the graph object model from the given stream.
Public methodStatic memberLoad(TextReader, GraphSchema[])Loads the graph object model from the given TextReader.
Public methodStatic memberLoad(String, GraphSchema[])Loads a new Graph object from the given file.
Public methodStatic memberLoad(XDocument, GraphSchema[])Loads the graph object model from the given XDocument.
Public methodStatic memberLoad(XmlReader, GraphSchema[])Loads the graph object model from the given XmlReader.
Public methodStatic memberLoad(Stream, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given stream.
Public methodStatic memberLoad(TextReader, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given TextReader.
Public methodStatic memberLoad(String, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads a new Graph object from the given file.
Public methodStatic memberLoad(XDocument, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given XDocument.
Public methodStatic memberLoad(XmlReader, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given XmlReader.
Public methodLoadAndMerge(Stream, GraphSchema[])Loads the graph object model from the given stream and merges it into the graph.
Public methodLoadAndMerge(String, GraphSchema[])Loads the graph object model from the given file and merges it in to the graph.
Public methodLoadAndMerge(XDocument, GraphSchema[])Loads the graph object model from the given XDocument and merges it into the graph.
Public methodLoadAndMerge(Stream, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given stream and merges it in to the graph.
Public methodLoadAndMerge(String, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given file and merges it in to the graph.
Public methodLoadAndMerge(XDocument, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads the graph object model from the given XDocument and merges it into the graph.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMerge(Graph)Merges all new nodes and links from the given graph into this graph.
Public methodMerge(IEnumerable<GraphConditionalStyle>)Merges all the styles from the given list.
Public methodMerge(IEnumerable<GraphLink>)Merges all of the links from the given link list into this graph.
Public methodMerge(IEnumerable<GraphNode>)Merges all of the nodes from the given node list into this graph.
Public methodMerge(IEnumerable<GraphObject>)Merges all new nodes and links from the given list of graph objects into this graph.
Protected methodOnCategoryChanged (Inherited from GraphObject.)
Public methodOnPropertyChanged(String)Raises a PropertyChangd event for the named property. (Inherited from GraphObject.)
Public methodOnPropertyChanged(GraphProperty)Raises a PropertyChangd event for the given GraphProperty. (Inherited from GraphObject.)
Public methodStatic memberParse(String, GraphSchema[])Loads a new Graph object from the given in-memory string that contains DGML markup.
Public methodStatic memberParse(String, EventHandler<GraphDeserializationProgressEventArgs>, GraphSchema[])Loads a new Graph object from the given in-memory string that contains DGML markup.
Public methodParseSerializedNodeIdParses a serialized node ID into a fully expanded GraphNodeId.
Public methodRemoveCategoryRemoves the category of this object. (Inherited from GraphObject.)
Public methodRenameNode(String, String)Renames a Node in the Graph (clones to new Node and removed original).
Public methodRenameNode(GraphNode, GraphNodeId)Renames a Node in the Graph (clones to new Node and removed original).
Public methodRenameNode(GraphNodeId, GraphNodeId)Renames a Node in the Graph (clones to new Node and removed original).
Public methodSave(Stream, GraphSerializationSettings)Save the graph to the output stream with the given settings.
Public methodSave(String, GraphSerializationSettings)Saves the Graph the a file.
Public methodSave(XmlWriter, GraphSerializationSettings)Saves the graph to the XmlWriter with the given settings.
Public methodSetValue(String, Object)Adds an annotation, using the given key, type, and value. (Inherited from GraphObject.)
Public methodSetValue<T>(GraphProperty, T)Sets the value of the given property. If the property already exists, its value is overwritten unless the annotation flags prevent otherwise. (Inherited from GraphObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodToXml()Converts the graph to XML using the GraphSerializer.
Public methodToXml(Int32)Converts the graph to XML using the GraphSerializer.
Protected methodWrapGraphObjectModifies the current graph object to share the same property and categories as the given graph object. The wrapper and wrappee graph objects will always have identical sets of properties and categories. (Inherited from GraphObject.)
Top

  NameDescription
Public eventBeginUndoableTransactionScopeWill be notified when an UndoableGraphTransactionScope is opened by the Graph.BeginUpdate method.
Public eventCategoryChanged (Inherited from GraphObject.)
Public eventEndUndoableTransactionScopeWill be notified when the UndoableGraphTransactionScope opened by Graph.BeginUpdate is disposed.
Public eventPropertyChanged (Inherited from GraphObject.)
Public eventUpdatedEvent implementation for GraphUpdated.
Public eventUpdatingEvent implementation for BeforeUpdate. This is an event that can be listened on and cancel the changes to a graph.
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft