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.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.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
- element
Type: Microsoft.VisualStudio.Modeling.ModelElement
The extended ModelElement
Return Value
Type: T
.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.