Delen via


ModelElement.TryGetExtension<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 the result will be null.

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

Syntax

'Declaration
Public Shared Function TryGetExtension(Of T As ExtensionElement) ( _
    element As ModelElement _
) As T
public static T TryGetExtension<T>(
    ModelElement element
)
where T : ExtensionElement
public:
generic<typename T>
where T : ExtensionElement 
static T TryGetExtension(
    ModelElement^ element
)
static member TryGetExtension : 
        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

TryGetExtension Overload

Microsoft.VisualStudio.Modeling Namespace