LinkedElementCollection<T> Class
Provides a collection of all elements that are linked to an element.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Modeling.ReadOnlyLinkedElementCollection<T>
Microsoft.VisualStudio.Modeling.LinkedElementCollection<T>
Namespace: Microsoft.VisualStudio.Modeling
Assembly: Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)
Syntax
'Declaration
Public Class LinkedElementCollection(Of T As ModelElement) _
Inherits ReadOnlyLinkedElementCollection(Of T) _
Implements IList(Of T), ICollection(Of T), _
IEnumerable(Of T), IBindingList, IList, ICollection, IEnumerable
public class LinkedElementCollection<T> : ReadOnlyLinkedElementCollection<T>,
IList<T>, ICollection<T>, IEnumerable<T>, IBindingList, 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>, IBindingList, IList,
ICollection, IEnumerable
type LinkedElementCollection<'T when 'T : ModelElement> =
class
inherit ReadOnlyLinkedElementCollection<'T>
interface IList<'T>
interface ICollection<'T>
interface IEnumerable<'T>
interface IBindingList
interface IList
interface ICollection
interface IEnumerable
end
JScript does not support generic types or methods.
Type Parameters
- T
The LinkedElementCollection<T> type exposes the following members.
Constructors
Name | Description | |
---|---|---|
LinkedElementCollection<T>() | Initializes a new instance of the LinkedElementCollection<T> class used for data binding. | |
LinkedElementCollection<T>(ModelElement, Guid) | Initializes a new instance of the LinkedElementCollection<T> class for a specified element. |
Top
Properties
Name | Description | |
---|---|---|
CommittedCount | Gets the actual number of role players in collection (after commit) (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
Count | Gets the number of role players in the collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
IntermediateCount | Gets the intermediate number of role players in collection(during commit). (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
Item | Gets or sets the role at a specified index in a collection of linked elements. | |
SourceDomainRole | Gets the source role of the relationship that this collection represents. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
SourceElement | Gets the source role player which was inherited by this collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
TargetDomainRole | Gets the target role of the relationship that this collection represents. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
TypeForAddNew |
Top
Methods
Name | Description | |
---|---|---|
Add | Appends a new role to the end of the collection. | |
AddNew | Add and merge in a new element to the collection | |
AddNewCore | Common implementation of logic to add and merge in a new element to the collection | |
AddRange | Appends a range of elements to the end of the collection. | |
AsReadOnly | Gets a read-only collection of linked elements. | |
Clear | Removes all roles from the collection. | |
Contains | Gets whether a specified role player belongs to the collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
CopyTo | Copies all role players to an array. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Exists | Determines whether there is at least one element for which a given condition is true. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Find | Finds the first element in the collection which matches a given condition. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
FindAll | Finds all elements which satisfy a given condition. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
FindIndex | Finds the first element which satisfies a given condition. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
ForEach | Runs the specified action on all elements in the collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
GetEnumerator | Gets a strongly-typed enumerator for this collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetItemProperties | Returns a complete set of browsable properties for the item type of the collection. If real items exists in the collection, then replace the reflective ones with IMS ones where possible to allow transacted updates through them. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf | Gets the index of a role player inside the collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
Insert | Inserts a role into the collection at a specified index. | |
InsertRange | Inserts a range of elements into the collection at a specific index. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Move(Int32, Int32) | Moves a role to a new position inside the collection. | |
Move(T, Int32) | Moves a role to a new position inside the collection. | |
Remove | Removes the specified role from the collection. | |
RemoveAt | Removes the role at a specified index from the collection. | |
RemoveRange | Removes a range of elements from the collection. | |
ReplaceAt | Replaces a role at a specified index with a new role. | |
Sort() | Sorts the elements in the collection of element links. | |
Sort(IComparer<T>) | Sorts the elements in the collection of element links. | |
Sort(Comparison<T>) | Sorts the elements in the collection of element links. | |
Sort(Int32, Int32, IComparer<T>) | Sorts a range of elements in the collection of element links. | |
ToArray | Creates an array and copies all role players in the collection into it. (Inherited from ReadOnlyLinkedElementCollection<T>.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TrueForAll | Checks if a given condition is true for all elements in the collection. (Inherited from ReadOnlyLinkedElementCollection<T>.) |
Top
Fields
Name | Description | |
---|---|---|
listChangedHandler | (Inherited from ReadOnlyLinkedElementCollection<T>.) |
Top
Explicit Interface Implementations
Top
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;
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.