Partager via


GraphObject Class

Definition

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

public ref class GraphObject abstract : Microsoft::VisualStudio::GraphModel::IHasGraphOwner, System::ComponentModel::INotifyPropertyChanged, System::Dynamic::IDynamicMetaObjectProvider
public abstract class GraphObject : Microsoft.VisualStudio.GraphModel.IHasGraphOwner, System.ComponentModel.INotifyPropertyChanged, System.Dynamic.IDynamicMetaObjectProvider
type GraphObject = class
    interface IDynamicMetaObjectProvider
    interface INotifyPropertyChanged
    interface IHasGraphOwner
Public MustInherit Class GraphObject
Implements IDynamicMetaObjectProvider, IHasGraphOwner, INotifyPropertyChanged
Inheritance
GraphObject
Derived
Implements

Constructors

GraphObject()

Protected constructor for GraphObject

GraphObject(Graph)

Protected constructor for GraphObject

Properties

Categories

Return all categories. Never returns null.

CategoryCount

Return number of categories in the object.

DescriptiveCategoryLabel

Creates a delimited list of all category labels for this graph object.

DocumentSchema

Get the document local schema from the Owner of this graph.

IsGroup

Get whether this object is is a group. It looks for the GraphCommonSchema.Group property on the object.

IsPseudo

Get whether this object is Pseudo. It looks for the GraphProperties.IsPseudo

Item[GraphProperty]

Property that gets or sets a property value.

Owner

Get the Graph object that this object belongs to.

Properties

Property that returns an enumeration of all annotations. The order of the enumeration is random.

PropertyCount

Property that returns an number of of all annotations.

PropertyKeys

Property that returns an enumeration of all annotation keys. The order of the enumeration is random.

PropertyValues

Property that returns an enumeration of all annotation values. The order of the enumeration is random.

Visibility

Helper property to get/set visibility property of a GraphObject

Methods

AddCategory(GraphCategory)

Add a category to the object

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.

ClearCategories()

Remove all categories from this object.

ClearValue(GraphProperty)

Removes the value of the specified property

ClearValue<T>(GraphProperty)

Clear the value of the specified property.

CopyCategories(GraphObject)

Copy any new categories from the given object, keeping existing categories.

CopyProperties(GraphObject)

Copy any new properties from the given object, keeping existing property values unchanged.

GetDerivedCategory(GraphCategory)

Return first matching leaf category that has the given category in its heirarchy.

GetDerivedCategory(String)

Return first matching leaf category that has the given category in its heirarchy.

GetMetaObject(Expression)
GetSchemaValue(GraphProperty)

Gets the schema specific value of the property if one exists.

GetValue(GraphProperty)

Gets the value of the specified annotation.

GetValue(String)

Gets the value of the specified property.

GetValue<T>(GraphProperty, Graph, GraphCategory)

Gets the value of the specified property, and also return the category that this property value was inherited from if any.

GetValue<T>(GraphProperty, Graph)

Gets the value of the specified property.

GetValue<T>(GraphProperty, T)

Gets the value of the specified annotation. if property is not set we reutnr the default value that the caller pass to this method

GetValue<T>(GraphProperty)

Gets the value of the specified property.

GetValue<T>(String)

Gets the value of the specified property.

GetValueAsString(GraphProperty, CultureInfo)

Returns the given property as a string using the given culture.

HasCategory(GraphCategory)

Return true if the object has the given category.

HasCategory(IEnumerable<GraphCategory>)

Return true if the object has any of the given categories.

HasCategory(String)

Return true if the object has the given category.

HasCategoryInSet(HashSet<GraphCategory>, GraphCategoryMatchOption)

Determines if the given set of categories applies to this object.

HasLocalValue(GraphProperty)

Return true if the specified property exists on this object with no cateogry inheritance check.

HasValue(GraphProperty)

Return true if the specified annotation exists.

HasValue(String)

Find out if the object has a value for the specified property.

OnCategoryChanged(GraphCategory, GraphCategoryChangeType)
OnPropertyChanged(GraphProperty)

Raise a PropertyChangd event for the given GraphProperty

OnPropertyChanged(String)

Raise a PropertyChangd event for the named property

RemoveCategory(GraphCategory)

Remove the category of this object

SetValue(String, Object)

Add an annotation using the given key, type and value

SetValue<T>(GraphProperty, T)

Sets the value of the given property. If the proeprty already exists, its value is overwritten unless the annotation flags prevent otherwise.

WrapGraphObject(GraphObject)

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.

Events

CategoryChanged
PropertyChanged

Extension Methods

DEBUG_GetLabelOrId(GraphObject)

Returns the label of an object or the id if the label is null. Should be used for tracing Microsoft.VisualStudio.Diagnostics.PerformanceProvider.DebugTrace.IDebugTracer

Applies to