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
property
Type: Microsoft.VisualStudio.GraphModel.GraphPropertyThe property you want to set.
value
Type: TThe 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.