ModelElement::AddExtension Method (ModelElement^, ExtensionElement^)
Visual Studio 2015
Extend the specified ModelElement with a specified extension. An InvalidOperationException will be thrown if the element already has an extension of the same type.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)
public: static ExtensionElement^ AddExtension( ModelElement^ element, ExtensionElement^ extension )
Parameters
- element
-
Type:
Microsoft.VisualStudio.Modeling::ModelElement^
ModelElement to be extended
- extension
-
Type:
Microsoft.VisualStudio.Modeling::ExtensionElement^
The ExtensionElement to be added
Although attempts to add a duplicate extension type are caught here, there are other cases where extensions may clash by contributing duplicate properties or roles, for example when two extensions are added that inherit from a common base that defines IMS properties and/or roles. Such cases are detected by IMergeElements implementation on ModelElement, but not by this low-level API
Show: