Export (0) Print
Expand All

ModelElementExtensionMethods Class

These extension methods allow a DSL to be extended without altering the original definition.

System.Object
  Microsoft.VisualStudio.Modeling.Extensibility.ModelElementExtensionMethods

Namespace:  Microsoft.VisualStudio.Modeling.Extensibility
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)

public static class ModelElementExtensionMethods

The ModelElementExtensionMethods type exposes the following members.

  NameDescription
Public methodStatic memberAddExtension(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 methodStatic memberAddExtension(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 methodStatic memberAddExtension(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 methodStatic memberAddExtension(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 methodStatic memberAddExtension<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 methodStatic memberGetAllExtensionsReturn an enumerable that performs a breadth first traversal across the tree of extension elements embedded in this ModelElement.
Public methodStatic memberGetBaseElementReturns the root of the virtual MEL in which the specified ModelElement is participating.
Public methodStatic memberGetExtension(ModelElement, DomainClassInfo)
Public methodStatic memberGetExtension(ModelElement, Guid)
Public methodStatic memberGetExtension(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 methodStatic memberGetExtension<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 methodStatic memberIsExtendedBy(ModelElement, DomainClassInfo)Query whether this ModelElement is currently extended by an ExtensionElement of a particular type.
Public methodStatic memberIsExtendedBy(ModelElement, Guid)Query whether this ModelElement is currently extended by an ExtensionElement of a particular type.
Public methodStatic memberIsExtendedBy(ModelElement, Type)Query whether this ModelElement is currently extended by an ExtensionElement of a particular type.
Public methodStatic memberRemoveExtension(ModelElement, DomainClassInfo)Remove any extension of the specified ModelElement that is of a particular type.
Public methodStatic memberRemoveExtension(ModelElement, ExtensionElement)Remove a specified ExtensionElement from the extensions of this ModelElement.
Public methodStatic memberRemoveExtension(ModelElement, Guid)Remove any extension of the specified ModelElement that is of a particular type.
Public methodStatic memberRemoveExtension(ModelElement, Type)Remove any extension of this ModelElement that is of a particular type.
Public methodStatic memberTryGetExtension(ModelElement, DomainClassInfo)
Public methodStatic memberTryGetExtension(ModelElement, Guid)
Public methodStatic memberTryGetExtension(ModelElement, Type)
Public methodStatic memberTryGetExtension<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

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft