PostSharp SDK6.6//Post­Sharp.​Sdk.​Code­Model.​Collections Namespace/Element­Collection(T) Class

ElementCollection<T> Class

Collection of elements (Element).
Inheritance Hierarchy
System.Object
  PostSharp.Sdk.CodeModel.Collections.ElementCollection
    PostSharp.Sdk.CodeModel.Collections.ElementCollection<T>
      More...

Namespace:  PostSharp.Sdk.CodeModel.Collections
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.6.3.0 (6.6.3.0)
Syntax
C#
public abstract class ElementCollection<T> : ElementCollection, 
	IPreAllocatedCollection<T>, ICollection<T>, IEnumerable<T>, IEnumerable, ICollection
where T : Element

Type Parameters

T
A type derived from Element.

The ElementCollection<T> type exposes the following members.

Properties
  NameDescription
Public propertyCount
Gets the number of elements contained in the ICollection<T>.
Public propertyIsDisposed Obsolete.
Determines whether the current collection has been disposed.
Protected propertyIsLazyLoadingSupported
Determines if the current collection supports lazy loading.
Public propertyIsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
Public propertyOwner
Gets the owner Element.
Public propertyRole
Gets the role of the current collection in the owner element.
Methods
  NameDescription
Public methodAdd
Adds an item to the ICollection<T>.
Public methodAddRange
Adds a collection of items to the current collection.
Public methodClear
Removes all items from the ICollection<T>.
Public methodClearCache
Clear the cache (typically mapping to System.Reflection or, if the current element is a reference, to the related definition) of all items of this collection.
Public methodContains
Determines whether the ICollection<T> contains a specific value.
Public methodCopyTo
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Public methodDispose Obsolete.
Disposes the resources held by the current instance.
Protected methodDoLazyLoading
Loads the content of the collection.
Public methodEndImport
Public methodEnsureCapacity
Allocates additional capacity in the collection.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnItemAdding
Called before adding an item to the collection.
Protected methodOnItemRemoved
Called before removing an item from the collection.
Public methodRemove
Removes the first occurrence of a specific object from the ICollection<T>.
Public methodToArray
Converts the current collection into a typed array.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Extension Methods
  NameDescription
Public Extension MethodAddRangeCloned<T>
Adds clones of items of a given collection to the current collection.
(Defined by ElementCollectionExtensions.)
Public Extension MethodAddRangeClonedTranslated<T> (Defined by ElementCollectionExtensions.)
Remarks

This collection should be owned by an Element. The objective of the current class is to notify the owner element that a child was added or removed. In order for the owner element to know to which collection the child belongs, each collection has a role in the owner collection.

This class maintains the parent-child relationship.

In order to save memory, the underlying collection is created only on demand. Empty collections should not have underlying collection.

See Also
Inheritance Hierarchy