ModelElementExtensionMethods.GetExtension<T> Method (ModelElement)

 

Get the ExtensionElement of the specified type from the available extensions of this ModelElement. If the element has no such extension then an InvalidOperationException will be raised.

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

public static T GetExtension<T>(
	this ModelElement element
)
where T : ExtensionElement

Parameters

element
Type: Microsoft.VisualStudio.Modeling.ModelElement

The extended ModelElement

Return Value

Type: T

The ExtensionElement of the requested type

Type Parameters

T

The type of ExtensionElement to retrieve

Return to top
Show: