Click or drag to resize
CollectionBaseT Class
CollectionBase is a base class that can be used to more easily implement the generic ICollection<T> and non-generic ICollection interfaces.
Inheritance Hierarchy
SystemObject
  X3Platform.CollectionsCollectionBaseT
    More...

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
[SerializableAttribute]
public abstract class CollectionBase<T> : ICollection<T>, 
	IEnumerable<T>, ICollection, IEnumerable

Type Parameters

T
The item type of the collection.

The CollectionBaseT type exposes the following members.

Constructors
  NameDescription
Protected methodCollectionBaseT
Initializes a new instance of the CollectionBaseT class
Top
Methods
  NameDescription
Public methodAdd
Must be overridden to allow adding items to this collection.
Public methodAsReadOnly
Provides a read-only view of this collection. The returned ICollection<T> provides a view of the collection that prevents modifications to the collection. Use the method to provide access to the collection without allowing changes. Since the returned object is just a view, changes to the collection will be reflected in the view.
Public methodClear
Must be overridden to allow clearing this collection.
Public methodContains
Determines if the collection contains a particular item. This default implementation iterates all of the items in the collection via GetEnumerator, testing each item against item using IComparable<T>.Equals or Object.Equals.
Public methodConvertAllTOutput
Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration contains the result of applying converter to each item in this collection, in order.
Public methodCopyTo
Copies all the items in the collection into an array. Implemented by using the enumerator returned from GetEnumerator to get all the items and copy them to the provided array.
Public methodCountWhere
Counts the number of items in the collection that satisfy the condition defined by predicate.
Public methodEquals (Inherited from Object.)
Public methodExists
Determines if the collection contains any item that satisfies the condition defined by predicate.
Protected methodFinalize (Inherited from Object.)
Public methodFindAll
Enumerates the items in the collection that satisfy the condition defined by predicate.
Public methodForEach
Performs the specified action on each item in this collection.
Public methodGetEnumerator
Must be overridden to enumerate all the members of the collection.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove
Must be overridden to allow removing items from this collection.
Public methodRemoveAll
Removes all the items in the collection that satisfy the condition defined by predicate.
Public methodToArray
Creates an array of the correct size, and copies all the items in the collection into the array, by calling CopyTo.
Public methodToString
Shows the string representation of the collection. The string representation contains a list of the items in the collection. Contained collections (except string) are expanded recursively.
(Overrides ObjectToString.)
Public methodTrueForAll
Determines if all of the items in the collection satisfy the condition defined by predicate.
Top
Properties
  NameDescription
Public propertyCount
Must be overridden to provide the number of items in the collection.
Top
Remarks

To use CollectionBase as a base class, the derived class must override the Count, GetEnumerator, Add, Clear, and Remove methods.

ICollection<T>.Contains need not be implemented by the derived class, but it should be strongly considered, because the CollectionBase implementation may not be very efficient.

See Also
Inheritance Hierarchy
SystemObject
  X3Platform.CollectionsCollectionBaseT
    X3Platform.CollectionsBagT
    X3Platform.CollectionsDictionaryBaseTKey, TValue
    X3Platform.CollectionsListBaseT
    X3Platform.CollectionsMultiDictionaryBaseTKey, TValue
    X3Platform.CollectionsOrderedBagT
    X3Platform.CollectionsOrderedBagTView
    X3Platform.CollectionsOrderedSetT
    X3Platform.CollectionsOrderedSetTView
    X3Platform.CollectionsSetT