LinkedElementCollection<T> Class

Provides a collection of all elements that are linked to an element.

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

Syntax

'Declaration
Public Class LinkedElementCollection(Of T As ModelElement) _
    Inherits ReadOnlyLinkedElementCollection(Of T) _
    Implements IList(Of T), ICollection(Of T),  _
    IEnumerable(Of T), IList, ICollection, IEnumerable
'Usage
Dim instance As LinkedElementCollection(Of T)
public class LinkedElementCollection<T> : ReadOnlyLinkedElementCollection<T>, 
    IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, 
    IEnumerable 
where T : ModelElement
generic<typename T>
where T : ModelElement 
public ref class LinkedElementCollection : public ReadOnlyLinkedElementCollection<T>, 
    IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, 
    IEnumerable
JScript does not support generic types or methods.

Type Parameters

  • T

Remarks

This is a strongly typed collection that refers to the opposite element instances for a relationship in which a particular element participates.

This collection provides navigation to all elements linked to an element.

Examples

This example assumes class A can have a multiplicity of class B instances. Also, class A has a property named C that represents elements linked to an instance of A.

// A a;
// B b1, b2, b3;
LinkedElementCollection<B> elementsLinkedToA = a.C;

// If class A has a multiplicity allowing only one B, the property type will be B.
// B elementLinkedToA = a.B;

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.ReadOnlyLinkedElementCollection<T>
    Microsoft.VisualStudio.Modeling.LinkedElementCollection<T>

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

LinkedElementCollection<T> Members

Microsoft.VisualStudio.Modeling Namespace