GraphObject Class

This class makes an object extensible by adding a strongly typed property bag of name/value pairs.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.GraphModel.GraphObject
    Microsoft.VisualStudio.GraphModel.Graph
    Microsoft.VisualStudio.GraphModel.GraphGroup
    Microsoft.VisualStudio.GraphModel.GraphLink
    Microsoft.VisualStudio.GraphModel.GraphMetadata
    Microsoft.VisualStudio.GraphModel.GraphNode
    Microsoft.VisualStudio.GraphModel.Styles.GraphCondition
    Microsoft.VisualStudio.GraphModel.Styles.GraphConditionalStyle
    Microsoft.VisualStudio.GraphModel.Styles.GraphSetter

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

Syntax

'Declaration
Public MustInherit Class GraphObject _
    Implements IDynamicMetaObjectProvider, INotifyPropertyChanged, IHasGraphOwner
public abstract class GraphObject : IDynamicMetaObjectProvider, 
    INotifyPropertyChanged, IHasGraphOwner
public ref class GraphObject abstract : IDynamicMetaObjectProvider, 
    INotifyPropertyChanged, IHasGraphOwner
[<AbstractClass>]
type GraphObject =  
    class 
        interface IDynamicMetaObjectProvider 
        interface INotifyPropertyChanged 
        interface IHasGraphOwner 
    end
public abstract class GraphObject implements IDynamicMetaObjectProvider, INotifyPropertyChanged, IHasGraphOwner

The GraphObject type exposes the following members.

Constructors

  Name Description
Protected method GraphObject() Protected constructor for Annotatable.
Protected method GraphObject(Graph) Protected constructor for Annotatable.

Top

Properties

  Name Description
Public property Categories Returns all categories. Never returns null.
Public property CategoryCount Returns the number of categories in the object.
Public property DescriptiveCategoryLabel Creates a delimited list of all category labels for this graph object.
Public property DocumentSchema Gets the document-local schema from the owner of this graph.
Public property IsGroup Gets whether this object is IsGroup. It looks for the GraphProperties.StyleForGroup.
Public property IsPseudo Gets whether this object is Pseudo. It looks for the GraphProperties.IsPseudo.
Public property Item Property that gets or sets a property value.
Public property Owner Gets the Graph object that this object belongs to.
Public property Properties Property that returns an enumeration of all annotations. The order of the enumeration is random.
Public property PropertyCount Property that returns a number of all annotations.
Public property PropertyKeys Property that returns an enumeration of all annotation keys. The order of the enumeration is random.
Public property PropertyValues Property that returns an enumeration of all annotation values. The order of the enumeration is random.
Public property Visibility Helper property to get/set visibility property of a GraphObject.

Top

Methods

  Name Description
Public method AddCategory Adds a category to the object.
Public method AsNode Converts the GraphObject to a GraphNode. If this is a GraphGroup, the inner node is returned. For types other than GraphNode/Group, null is returned.
Public method ClearCategories Remove all categories from this object.
Public method ClearValue(GraphProperty) Removes the value of the specified property.
Public method ClearValue<T>(GraphProperty) Clears the value of the specified property.
Public method CopyCategories Copies any new categories from the given object, keeping existing categories.
Public method CopyProperties Copies any new properties from the given object, keeping existing property values unchanged.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetMetaObject
Protected method GetSchemaValue Gets the schema-specific value of the property, if one exists.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValue(String) Gets the value of the specified property.
Public method GetValue(GraphProperty) Gets the value of the specified annotation.
Public method GetValue<T>(String) Gets the value of the specified property.
Public method GetValue<T>(GraphProperty) Gets the value of the specified property.
Public method GetValue<T>(GraphProperty, Graph) Gets the value of the specified property.
Public method GetValue<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.
Public method GetValue<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.
Public method GetValueAsString Returns the given property as a string that uses the given culture.
Public method HasCategory(String) Returns true if the object has the given category.
Public method HasCategory(GraphCategory) Returns true if the object has the given category.
Public method HasCategory(IEnumerable<GraphCategory>) Returns true if the object has any of the given categories.
Public method HasCategoryInSet Determines whether the given set of categories applies to this object.
Public method HasLocalValue Returns true if the specified property exists on this object with no category inheritance check.
Public method HasValue(String) Find out whether the object has a value for the specified property.
Public method HasValue(GraphProperty) Returns true if the specified annotation exists.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnCategoryChanged
Public method OnPropertyChanged(String) Raises a PropertyChangd event for the named property.
Public method OnPropertyChanged(GraphProperty) Raises a PropertyChangd event for the given GraphProperty.
Public method RemoveCategory Removes the category of this object.
Public method SetValue(String, Object) Adds an annotation, using the given key, type, and value.
Public method SetValue<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.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method WrapGraphObject Modifies 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.

Top

Events

  Name Description
Public event CategoryChanged
Public event PropertyChanged

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.GraphModel Namespace