Condividi tramite


ModelElementExtensionMethods.AddExtension Method

Definition

Overloads

AddExtension(ModelElement, DomainClassInfo)

Extend this ModelElement with a newly instantiated extension of the specified domain type. An InvalidOperationException will be thrown if the element already has an extension of that type.

AddExtension(ModelElement, ExtensionElement)

Extend this ModelElement with a specific extension. An InvalidOperationException will be thrown if the element already has an extension of the same type.

AddExtension(ModelElement, Guid)

Extend this ModelElement with newly instantiated extension of the identified domain type. An InvalidOperationException will be thrown if the element already has an extension of that type.

AddExtension(ModelElement, Type)

Extend this ModelElement with a newly instantiated extension of the specified type. An InvalidOperationException will be thrown if the element already has an extension of that type.

AddExtension<T>(ModelElement)

Extend this ModelElement with a newly instantiated extension of a particular type. An InvalidOperationException will be thrown if the element already has an extension of the same type.

AddExtension(ModelElement, DomainClassInfo)

Extend this ModelElement with a newly instantiated extension of the specified domain type. An InvalidOperationException will be thrown if the element already has an extension of that type.

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

Parameters

element
ModelElement

ModelElement to be extended

extensionClass
DomainClassInfo

The domain class of the type of ExtensionElement to be added

Returns

The newly instantiated and added extension

Applies to

AddExtension(ModelElement, ExtensionElement)

Extend this ModelElement with a specific extension. An InvalidOperationException will be thrown if the element already has an extension of the same type.

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

Parameters

element
ModelElement

ModelElement to be extended

extension
ExtensionElement

The ExtensionElement to be added

Returns

The added extension

Applies to

AddExtension(ModelElement, Guid)

Extend this ModelElement with newly instantiated extension of the identified domain type. An InvalidOperationException will be thrown if the element already has an extension of that type.

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

Parameters

element
ModelElement

ModelElement to be extended

extensionClassId
Guid

The domain class id of the type of ExtensionElement to be added

Returns

The newly instantiated and added extension

Applies to

AddExtension(ModelElement, Type)

Extend this ModelElement with a newly instantiated extension of the specified type. An InvalidOperationException will be thrown if the element already has an extension of that type.

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

Parameters

element
ModelElement

ModelElement to be extended

extensionType
Type

Returns

The newly instantiated and added extension

Applies to

AddExtension<T>(ModelElement)

Extend this ModelElement with a newly instantiated extension of a particular type. An InvalidOperationException will be thrown if the element already has an extension of the same type.

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

Type Parameters

T

The type of ExtensionElement to be added

Parameters

element
ModelElement

ModelElement to be extended

Returns

T

The newly instantiated and added extension

Applies to