ModelElement.GetExtension<T> Method (ModelElement)

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

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

Syntax

'Declaration
Public Shared Function GetExtension(Of T As ExtensionElement) ( _
    element As ModelElement _
) As T
public static T GetExtension<T>(
    ModelElement element
)
where T : ExtensionElement
public:
generic<typename T>
where T : ExtensionElement
static T GetExtension(
    ModelElement^ element
)
static member GetExtension : 
        element:ModelElement -> 'T  when 'T : ExtensionElement
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of ExtensionElement to retrieve

Parameters

Return Value

Type: T

.NET Framework Security

See Also

Reference

ModelElement Class

GetExtension Overload

Microsoft.VisualStudio.Modeling Namespace