ModelElement.TryGetExtension Method

Definition

Overloads

TryGetExtension(ModelElement, DomainClassInfo)
TryGetExtension(ModelElement, Guid)
TryGetExtension(ModelElement, Type)
TryGetExtension<T>(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.

TryGetExtension(ModelElement, DomainClassInfo)

C++
public:
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ TryGetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Microsoft::VisualStudio::Modeling::DomainClassInfo ^ extensionClass);

Parameters

element
ModelElement
extensionClass
DomainClassInfo

Returns

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022

TryGetExtension(ModelElement, Guid)

C++
public:
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ TryGetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Guid extensionClassId);

Parameters

element
ModelElement
extensionClassId
Guid

Returns

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022

TryGetExtension(ModelElement, Type)

C++
public:
 static Microsoft::VisualStudio::Modeling::ExtensionElement ^ TryGetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element, Type ^ extensionType);

Parameters

element
ModelElement
extensionType
Type

Returns

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022

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

C++
public:
generic <typename T>
 where T : Microsoft::VisualStudio::Modeling::ExtensionElement static T TryGetExtension(Microsoft::VisualStudio::Modeling::ModelElement ^ element);

Type Parameters

T

The type of ExtensionElement to retrieve

Parameters

element
ModelElement

The extended ModelElement

Returns

T

The ExtensionElement of the requested type, or null if the element has no such extension

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2017, 2019, 2022