ModelElementExtensionMethods::AddExtension<T> Method (ModelElement^)

 

Extend this ModelElement with a newly instantiated extension of a particular type. An InvalidOperationException will be thrown if the element already has an extension of the same type.

Namespace:   Microsoft.VisualStudio.Modeling.Extensibility
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)

public:
generic<typename T>
where T : ExtensionElement
[ExtensionAttribute]
static T AddExtension(
	ModelElement^ element
)

Parameters

element
Type: Microsoft.VisualStudio.Modeling::ModelElement^

ModelElement to be extended

Return Value

Type: T

The newly instantiated and added extension

Type Parameters

T

The type of ExtensionElement to be added

Return to top
Show: