GraphObject.SetValue<T> Method (GraphProperty, T)

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

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

Syntax

'Declaration
Public Function SetValue(Of T) ( _
    property As GraphProperty, _
    value As T _
) As T
public T SetValue<T>(
    GraphProperty property,
    T value
)
public:
generic<typename T>
T SetValue(
    GraphProperty^ property, 
    T value
)
member SetValue : 
        property:GraphProperty * 
        value:'T -> 'T 
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of data being added.

Parameters

  • value
    Type: T

    The value of the property.

Return Value

Type: T
The value.

Exceptions

Exception Condition
ArgumentNullException

Thrown if key is null.

InvalidOperationException

Thrown if the value's type cannot be assigned to the annotation.

-or-

Thrown if trying to write to a "write-once" annotation multiple times.

.NET Framework Security

See Also

Reference

GraphObject Class

SetValue Overload

Microsoft.VisualStudio.GraphModel Namespace