Click or drag to resize
ReadOnlyCollectionBaseT Class
ReadOnlyCollectionBase is a base class that can be used to more easily implement the generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: a collection that does not allow adding or removing elements.
Inheritance Hierarchy

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

Type Parameters

T
The item type of the collection.

The ReadOnlyCollectionBaseT type exposes the following members.

Constructors
  NameDescription
Protected methodReadOnlyCollectionBaseT
Initializes a new instance of the ReadOnlyCollectionBaseT class
Top
Methods
  NameDescription
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 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.
(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 ReadOnlyCollectionBase as a base class, the derived class must override the Count and GetEnumerator methods.

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

See Also