ModelElementExtensionMethods Class
These extension methods allow a DSL to be extended without altering the original definition.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Modeling.Extensibility.ModelElementExtensionMethods
Namespace: Microsoft.VisualStudio.Modeling.Extensibility
Assembly: Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)
Syntax
'宣告
<ExtensionAttribute> _
Public NotInheritable Class ModelElementExtensionMethods
public static class ModelElementExtensionMethods
[ExtensionAttribute]
public ref class ModelElementExtensionMethods abstract sealed
[<AbstractClass>]
[<Sealed>]
type ModelElementExtensionMethods = class end
public final class ModelElementExtensionMethods
The ModelElementExtensionMethods type exposes the following members.
Methods
Name | Description | |
---|---|---|
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. | |
GetAllExtensions | Return an enumerable that performs a breadth first traversal across the tree of extension elements embedded in this ModelElement. | |
GetBaseElement | Returns the root of the virtual MEL in which the specified ModelElement is participating. | |
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. | |
IsExtendedBy(ModelElement, DomainClassInfo) | Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. | |
IsExtendedBy(ModelElement, Guid) | Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. | |
IsExtendedBy(ModelElement, Type) | Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. | |
RemoveExtension(ModelElement, DomainClassInfo) | Remove any extension of the specified ModelElement that is of a particular type. | |
RemoveExtension(ModelElement, ExtensionElement) | Remove a specified ExtensionElement from the extensions of this ModelElement. | |
RemoveExtension(ModelElement, Guid) | Remove any extension of the specified ModelElement that is of a particular type. | |
RemoveExtension(ModelElement, Type) | Remove any extension of this ModelElement that is of a particular type. | |
TryGetExtension(ModelElement, DomainClassInfo) | ||
TryGetExtension(ModelElement, Guid) | ||
TryGetExtension(ModelElement, Type) | ||
TryGetExtension<T>(ModelElement) | Get the ExtensionElement of the specified type from the available extensions of this ModelElement. If this element has no such extension then the result will be null. |
Top
Remarks
For more information see Adding Extensions to DSL Definitions.
Import the namespace Microsoft.VisualStudio.Modeling.Extensibility to make these operations available as if methods of ModelElement. Otherwise the same operations are available as static methods on ModelElement.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.