ElementLink Class

Base class for all domain relationships.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.ModelElement
    Microsoft.VisualStudio.Modeling.ElementLink
      More...

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

Syntax

声明
<SerializableAttribute> _
<DomainObjectIdAttribute("706debaa-dd2d-4293-99af-695aadd36c9a")> _
<DomainRelationshipAttribute(AllowsDuplicates := True)> _
Public MustInherit Class ElementLink _
    Inherits ModelElement
[SerializableAttribute]
[DomainObjectIdAttribute("706debaa-dd2d-4293-99af-695aadd36c9a")]
[DomainRelationshipAttribute(AllowsDuplicates = true)]
public abstract class ElementLink : ModelElement
[SerializableAttribute]
[DomainObjectIdAttribute(L"706debaa-dd2d-4293-99af-695aadd36c9a")]
[DomainRelationshipAttribute(AllowsDuplicates = true)]
public ref class ElementLink abstract : public ModelElement
[<AbstractClass>]
[<SerializableAttribute>]
[<DomainObjectIdAttribute("706debaa-dd2d-4293-99af-695aadd36c9a")>]
[<DomainRelationshipAttribute(AllowsDuplicates = true)>]
type ElementLink =  
    class
        inherit ModelElement
    end
public abstract class ElementLink extends ModelElement

The ElementLink type exposes the following members.

Constructors

  Name Description
Protected method ElementLink Creates a new instance of the ElementLink class.

Top

Properties

  Name Description
Public property Id Gets the ID of the element. (Inherited from ModelElement.)
Public property IsActive Gets the IsActive flag and verifies to see whether the element is active. (Inherited from ModelElement.)
Public property IsDeleted Gets the IsDeleted flag and checks to see whether the element has been deleted from the model. (Inherited from ModelElement.)
Public property IsDeleting Gets the IsDeleting flag and verifies whether the element is currently being deleted from the model. (Inherited from ModelElement.)
Public property LinkedElements Gets a read-only collection of elements connected by this element link.
Public property Partition Gets or sets the Partition that contains the element. (Inherited from ModelElement.)
Public property Store Gets the Store that contains the element. (Inherited from ModelElement.)

Top

Methods

  Name Description
Protected method CanMerge Verifies whether a source element can be added to this element. (Inherited from ModelElement.)
Protected method ChooseMergeTarget(ElementGroup) Selects a target element to accept as its child an element that the user wants to copy, drag, or create. (Inherited from ModelElement.)
Protected method ChooseMergeTarget(ElementGroupPrototype) Selects a target element to accept as its child an element that the user wants to copy, drag, or create. (Inherited from ModelElement.)
Public method Copy() Creates a copy of the element in the model. (Inherited from ModelElement.)
Public method Copy(IEnumerable<Guid>) Creates a copy of the element and its child links and elements. (Inherited from ModelElement.)
Public method Delete() Deletes an element from the model. (Inherited from ModelElement.)
Public method Delete(array<Guid[]) Deletes an element from the model. (Inherited from ModelElement.)
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetDomainClass Gets the most-derived domain class for this element. (Inherited from ModelElement.)
Public method GetDomainRelationship Gets the domain relationship that this link instantiates.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Protected method GetRoleCollection<TCollection, TElement>(Guid) Gets or creates the linked element collection (Inherited from ModelElement.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MergeConfigure Allows the model element to configure itself immediately after the Merge process has related it to the target element. (Inherited from ModelElement.)
Protected method MergeDisconnect Disconnects a source element from a target element. (Inherited from ModelElement.)
Protected method MergeRelate Creates a relationship between this target element and the specified source element. (Inherited from ModelElement.)
Public method MoveBefore Change the order of links connected to an element, moving this link before another.
Public method MoveToIndex Move this link to a specified index position in the list.
Protected method OnCopy Called when this element has been created as a copy of another element. (Inherited from ModelElement.)
Protected method OnDeleted Called when this element has been deleted from the model. (Inherited from ModelElement.)
Protected method OnDeleting Called when this element is about to be deleted. (Inherited from ModelElement.)
Protected method OnResurrected Called when this element has been added back to a model. (Inherited from ModelElement.)
Protected method OnRolePlayerChanged Called when the role player has been changed.
Protected method OnRolePlayerChanging Called when the role player will be changed.
Protected method OnRolePlayerPositionChanged Called when the position of a role has changed. (Inherited from ModelElement.)
Protected method OnRolePlayerPositionChanging Called when a role player position is about to change. (Inherited from ModelElement.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Extension Methods

  Name Description
Public Extension Method AddExtension(Guid) Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method AddExtension(Type) Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method AddExtension(DomainClassInfo) Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method AddExtension(ExtensionElement) Overloaded. Extend this ModelElement with a specific extension. An InvalidOperationException will be thrown if the element already has an extension of the same type. (Defined by ModelElementExtensionMethods.)
Public Extension Method AddExtension<T>() Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method CanDelete Deletes the element from the model. (Defined by ImmutabilityExtensionMethods.)
Public Extension Method GetAllExtensions Return an enumerable that performs a breadth first traversal across the tree of extension elements embedded in this ModelElement. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetBaseElement Returns the root of the virtual MEL in which the specified ModelElement is participating. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetExtension(Guid) Overloaded. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetExtension(Type) Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetExtension(DomainClassInfo) Overloaded. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetExtension<T>() Overloaded. 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. (Defined by ModelElementExtensionMethods.)
Public Extension Method GetLocks Get the lock flags for this element. This will include any locks enabled on the Partition containing the element. (Defined by ImmutabilityExtensionMethods.)
Public Extension Method IsExtendedBy(Guid) Overloaded. Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method IsExtendedBy(Type) Overloaded. Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method IsExtendedBy(DomainClassInfo) Overloaded. Query whether this ModelElement is currently extended by an ExtensionElement of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method IsLocked Test whether this element has any of a specified set of locks (Defined by ImmutabilityExtensionMethods.)
Public Extension Method RemoveExtension(Type) Overloaded. Remove any extension of this ModelElement that is of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method RemoveExtension(Guid) Overloaded. Remove any extension of the specified ModelElement that is of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method RemoveExtension(DomainClassInfo) Overloaded. Remove any extension of the specified ModelElement that is of a particular type. (Defined by ModelElementExtensionMethods.)
Public Extension Method RemoveExtension(ExtensionElement) Overloaded. Remove a specified ExtensionElement from the extensions of this ModelElement. (Defined by ModelElementExtensionMethods.)
Public Extension Method SetLocks Set the lock flags of this element (Defined by ImmutabilityExtensionMethods.)
Public Extension Method TryGetExtension(Guid) Overloaded. (Defined by ModelElementExtensionMethods.)
Public Extension Method TryGetExtension(Type) Overloaded. (Defined by ModelElementExtensionMethods.)
Public Extension Method TryGetExtension(DomainClassInfo) Overloaded. (Defined by ModelElementExtensionMethods.)
Public Extension Method TryGetExtension<T>() Overloaded. 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. (Defined by ModelElementExtensionMethods.)

Top

Fields

  Name Description
Public fieldStatic member DomainClassId ID of the domain class for the ElementLink.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IMergeElements.CanMerge Returns true if this element can merge with the content of the prototype. (Inherited from ModelElement.)
Explicit interface implemetationPrivate method IMergeElements.ChooseMergeTarget(ElementGroup) (Inherited from ModelElement.)
Explicit interface implemetationPrivate method IMergeElements.ChooseMergeTarget(ElementGroupPrototype) (Inherited from ModelElement.)
Explicit interface implemetationPrivate method IMergeElements.MergeConfigure (Inherited from ModelElement.)
Explicit interface implemetationPrivate method IMergeElements.MergeDisconnect (Inherited from ModelElement.)
Explicit interface implemetationPrivate method IMergeElements.MergeRelate (Inherited from ModelElement.)

Top

Remarks

When you define a domain relationship between two ModelElements in your DSL Definition, the generated class is derived from ElementLink. Many relationships in the DSL runtime and designer are also ElementLinks.

ElementLinks are also ModelElements, and can therefore have properties and be connected by links.

For more information, see Navigating and Updating a Model in Program Code.

Examples

[redirect] Walkthrough: Creating a Generated API

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.

See Also

Reference

Microsoft.VisualStudio.Modeling Namespace

Change History

Date

History

Reason

June 2010

Clarified descriptions.

Information enhancement.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.ModelElement
    Microsoft.VisualStudio.Modeling.ElementLink
      Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode
      Microsoft.VisualStudio.Modeling.Diagrams.ParentShapeContainsNestedChildShapes
      Microsoft.VisualStudio.Modeling.Diagrams.ParentShapeHasRelativeChildShapes
      Microsoft.VisualStudio.Modeling.Diagrams.PresentationViewsSubject
      Microsoft.VisualStudio.Modeling.DslDefinition.AttributedDomainElementHasAttributes
      Microsoft.VisualStudio.Modeling.DslDefinition.AttributeHasParameters
      Microsoft.VisualStudio.Modeling.DslDefinition.BaseShapeMapReferencesBaseShape
      Microsoft.VisualStudio.Modeling.DslDefinition.ClassHasBaseClass
      Microsoft.VisualStudio.Modeling.DslDefinition.ClassHasElementMergeDirectives
      Microsoft.VisualStudio.Modeling.DslDefinition.ClassHasProperties
      Microsoft.VisualStudio.Modeling.DslDefinition.ClassIndexesElementMergeDirective
      Microsoft.VisualStudio.Modeling.DslDefinition.CompartmentMapHasElementsDisplayedPath
      Microsoft.VisualStudio.Modeling.DslDefinition.CompartmentMapHasPropertyDisplayedPath
      Microsoft.VisualStudio.Modeling.DslDefinition.CompartmentMapsReferToCompartment
      Microsoft.VisualStudio.Modeling.DslDefinition.CompartmentShapeMapHasCompartmentMaps
      Microsoft.VisualStudio.Modeling.DslDefinition.ConnectionBuilderHasLinkConnectDirectives
      Microsoft.VisualStudio.Modeling.DslDefinition.ConnectorMapReferencesConnector
      Microsoft.VisualStudio.Modeling.DslDefinition.ConnectorMapReferencesRelationship
      Microsoft.VisualStudio.Modeling.DslDefinition.ConnectorToolReferencesConnectionBuilder
      Microsoft.VisualStudio.Modeling.DslDefinition.CustomPropertyDescriptor
      Microsoft.VisualStudio.Modeling.DslDefinition.DecoratorMapHasPropertyDisplayedPath
      Microsoft.VisualStudio.Modeling.DslDefinition.DecoratorMapHasVisibilityPropertyPath
      Microsoft.VisualStudio.Modeling.DslDefinition.DecoratorMapReferencesDecorator
      Microsoft.VisualStudio.Modeling.DslDefinition.DesignerHasDiagram
      Microsoft.VisualStudio.Modeling.DslDefinition.DiagramElementHasDecorators
      Microsoft.VisualStudio.Modeling.DslDefinition.DiagramElementMapHasDecoratorMaps
      Microsoft.VisualStudio.Modeling.DslDefinition.DiagramHasConnectorMaps
      Microsoft.VisualStudio.Modeling.DslDefinition.DiagramHasShapeMaps
      Microsoft.VisualStudio.Modeling.DslDefinition.DiagramRepresentsClass
      Microsoft.VisualStudio.Modeling.DslDefinition.DomainClassHasCustomTypeDescriptor
      Microsoft.VisualStudio.Modeling.DslDefinition.DomainPropertyHasElementNameProvider
      Microsoft.VisualStudio.Modeling.DslDefinition.DomainRoleHasPropertyAttributes
      Microsoft.VisualStudio.Modeling.DslDefinition.DomainRoleImplementedByCollectionType
      Microsoft.VisualStudio.Modeling.DslDefinition.DslDefinesEditor
      Microsoft.VisualStudio.Modeling.DslDefinition.DslDefinesExplorer
      Microsoft.VisualStudio.Modeling.DslDefinition.DslDefinesExplorerBehavior
      Microsoft.VisualStudio.Modeling.DslDefinition.DslEditorIdentifiesRootClass
      Microsoft.VisualStudio.Modeling.DslDefinition.DslLibraryHasConnectionBuilders
      Microsoft.VisualStudio.Modeling.DslDefinition.DslLibraryHasDslLibraryImports
      Microsoft.VisualStudio.Modeling.DslDefinition.DslLibraryHasReferenceTypes
      Microsoft.VisualStudio.Modeling.DslDefinition.DslLibraryHasTypes
      Microsoft.VisualStudio.Modeling.DslDefinition.DslLibraryHasXmlSerializationBehavior
      Microsoft.VisualStudio.Modeling.DslDefinition.EditorHasToolboxTabs
      Microsoft.VisualStudio.Modeling.DslDefinition.EditorHasValidation
      Microsoft.VisualStudio.Modeling.DslDefinition.EditorHasXmlSerializationDefinition
      Microsoft.VisualStudio.Modeling.DslDefinition.ElementMergeDirectiveHasForwardingPath
      Microsoft.VisualStudio.Modeling.DslDefinition.ElementMergeDirectiveHasLinkCreationPaths
      Microsoft.VisualStudio.Modeling.DslDefinition.EnumerationHasAttributes
      Microsoft.VisualStudio.Modeling.DslDefinition.EnumerationHasLiterals
      Microsoft.VisualStudio.Modeling.DslDefinition.ExplorerBehaviorHasNodeSettings
      Microsoft.VisualStudio.Modeling.DslDefinition.ExplorerHidesNodes
      Microsoft.VisualStudio.Modeling.DslDefinition.ExplorerNodeSettingsHasPropertyDisplayedPath
      Microsoft.VisualStudio.Modeling.DslDefinition.ExplorerNodeSettingsReferencesClass
      Microsoft.VisualStudio.Modeling.DslDefinition.ExplorerReferencesBehavior
      Microsoft.VisualStudio.Modeling.DslDefinition.LinkConnectDirectiveHasSourceDirectives
      Microsoft.VisualStudio.Modeling.DslDefinition.LinkConnectDirectiveHasTargetDirectives
      Microsoft.VisualStudio.Modeling.DslDefinition.LinkConnectDirectiveReferencesDomainRelationship
      Microsoft.VisualStudio.Modeling.DslDefinition.ObjectToolReferencesClass
      Microsoft.VisualStudio.Modeling.DslDefinition.PathHasSegments
      Microsoft.VisualStudio.Modeling.DslDefinition.PathSegmentReferencesRole
      Microsoft.VisualStudio.Modeling.DslDefinition.PropertyHasType
      Microsoft.VisualStudio.Modeling.DslDefinition.PropertyPathHasPath
      Microsoft.VisualStudio.Modeling.DslDefinition.PropertyPathReferencesProperty
      Microsoft.VisualStudio.Modeling.DslDefinition.RelationshipHasRoles
      Microsoft.VisualStudio.Modeling.DslDefinition.RoleHasRolePlayer
      Microsoft.VisualStudio.Modeling.DslDefinition.RolePlayerConnectDirectiveAcceptsClass
      Microsoft.VisualStudio.Modeling.DslDefinition.RolePlayerConnectDirectiveHasPathToRolePlayer
      Microsoft.VisualStudio.Modeling.DslDefinition.ShapeHasCompartments
      Microsoft.VisualStudio.Modeling.DslDefinition.ShapeMapHasParentElementPath
      Microsoft.VisualStudio.Modeling.DslDefinition.ShapeMapReferencesClass
      Microsoft.VisualStudio.Modeling.DslDefinition.ToolboxTabHasTools
      Microsoft.VisualStudio.Modeling.DslDefinition.VisibilityPropertyPathHasPropertyFilters
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlClassDataAppliesToDomainClass
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlClassDataHasXmlElementData
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlElementAppliesToDomainProperty
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlRelationshipDataAppliesToDomainRelationship
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlSerializationBehaviorHasXmlClassData
      Microsoft.VisualStudio.Modeling.DslDefinition.XmlSerializationDefinitionReferencesBehavior
      Microsoft.VisualStudio.Modeling.ExtensionExtendsElement