Freigeben über


ModelElementExtensionMethods.GetExtension Method

Definition

Overloads

GetExtension(ModelElement, DomainClassInfo)
GetExtension(ModelElement, Guid)
GetExtension(ModelElement, Type)

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.

GetExtension<T>(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.

GetExtension(ModelElement, DomainClassInfo)

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ GetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Microsoft::VisualStudio::Modeling::DomainClassInfo ^ extensionClass);
public static Microsoft.VisualStudio.Modeling.ExtensionElement GetExtension (this Microsoft.VisualStudio.Modeling.ModelElement element, Microsoft.VisualStudio.Modeling.DomainClassInfo extensionClass);
static member GetExtension : Microsoft.VisualStudio.Modeling.ModelElement * Microsoft.VisualStudio.Modeling.DomainClassInfo -> Microsoft.VisualStudio.Modeling.ExtensionElement
<Extension()>
Public Function GetExtension (element As ModelElement, extensionClass As DomainClassInfo) As ExtensionElement

Parameters

element
ModelElement
extensionClass
DomainClassInfo

Returns

Applies to

GetExtension(ModelElement, Guid)

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ GetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Guid extensionClassId);
public static Microsoft.VisualStudio.Modeling.ExtensionElement GetExtension (this Microsoft.VisualStudio.Modeling.ModelElement element, Guid extensionClassId);
static member GetExtension : Microsoft.VisualStudio.Modeling.ModelElement * Guid -> Microsoft.VisualStudio.Modeling.ExtensionElement
<Extension()>
Public Function GetExtension (element As ModelElement, extensionClassId As Guid) As ExtensionElement

Parameters

element
ModelElement
extensionClassId
Guid

Returns

Applies to

GetExtension(ModelElement, Type)

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.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ GetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Type ^ extensionType);
public static Microsoft.VisualStudio.Modeling.ExtensionElement GetExtension (this Microsoft.VisualStudio.Modeling.ModelElement element, Type extensionType);
static member GetExtension : Microsoft.VisualStudio.Modeling.ModelElement * Type -> Microsoft.VisualStudio.Modeling.ExtensionElement
<Extension()>
Public Function GetExtension (element As ModelElement, extensionType As Type) As ExtensionElement

Parameters

element
ModelElement

The extended ModelElement

extensionType
Type

The type of ExtensionElement to retrieve

Returns

The ExtensionElement of the requested type

Applies to

GetExtension<T>(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.

public:
generic <typename T>
 where T : Microsoft::VisualStudio::Modeling::ExtensionElement[System::Runtime::CompilerServices::Extension]
 static T GetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element);
public static T GetExtension<T> (this Microsoft.VisualStudio.Modeling.ModelElement element) where T : Microsoft.VisualStudio.Modeling.ExtensionElement;
static member GetExtension : Microsoft.VisualStudio.Modeling.ModelElement -> 'T (requires 'T :> Microsoft.VisualStudio.Modeling.ExtensionElement)
<Extension()>
Public Function GetExtension(Of T As ExtensionElement) (element As ModelElement) As T

Type Parameters

T

The type of ExtensionElement to retrieve

Parameters

element
ModelElement

The extended ModelElement

Returns

T

The ExtensionElement of the requested type

Applies to