Click or drag to resize
ListBaseT Class
ListBase is an abstract class that can be used as a base class for a read-write collection that needs to implement the generic IList<T> and non-generic IList collections. The derived class needs to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation of all the other methods in IList<T> and IList are handled by ListBase.
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 ListBase<T> : CollectionBase<T>, 
	IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, 
	IEnumerable

Type Parameters

T

The ListBaseT type exposes the following members.

Constructors
  NameDescription
Protected methodListBaseT
Initializes a new instance of the ListBaseT class
Top
Methods
  NameDescription
Public methodAdd
Adds an item to the end of the list. This method is equivalent to calling:
Insert(Count, item)
(Overrides CollectionBaseTAdd(T).)
Public methodAsReadOnly
Provides a read-only view of this list. The returned IList<T> provides a view of the list that prevents modifications to the list. Use the method to provide access to the list without allowing changes. Since the returned object is just a view, changes to the list will be reflected in the view.
Public methodClear
This method must be overridden by the derived class to empty the list of all items.
(Overrides CollectionBaseTClear.)
Public methodContains
Determines if the list contains any item that compares equal to item. The implementation simply checks whether IndexOf(item) returns a non-negative value.
(Overrides CollectionBaseTContains(T).)
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.
(Inherited from CollectionBaseT.)
Public methodCopyTo(T)
Copies all the items in the list, in order, to array, starting at index 0.
Public methodCopyTo(T, Int32)
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.
(Inherited from CollectionBaseT.)
Public methodCopyTo(Int32, T, Int32, Int32)
Copies a range of elements from the list to array, starting at arrayIndex.
Public methodCountWhere
Counts the number of items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodEquals (Inherited from Object.)
Public methodExists
Determines if the collection contains any item that satisfies the condition defined by predicate.
(Inherited from CollectionBaseT.)
Protected methodFinalize (Inherited from Object.)
Public methodFind
Finds the first item in the list that satisfies the condition defined by predicate. If no item matches the condition, than the default value for T (null or all-zero) is returned.
Public methodFindAll
Enumerates the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodFindIndex(PredicateT)
Finds the index of the first item in the list that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodFindIndex(Int32, PredicateT)
Finds the index of the first item, in the range of items extending from index to the end, that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodFindIndex(Int32, Int32, PredicateT)
Finds the index of the first item, in the range of count items starting from index, that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodFindLast
Finds the last item in the list that satisfies the condition defined by predicate. If no item matches the condition, than the default value for T (null or all-zero) is returned.
Public methodFindLastIndex(PredicateT)
Finds the index of the last item in the list that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodFindLastIndex(Int32, PredicateT)
Finds the index of the last item, in the range of items extending from the beginning of the list to index, that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodFindLastIndex(Int32, Int32, PredicateT)
Finds the index of the last item, in the range of count items ending at index, that satisfies the condition defined by predicate. If no item matches the condition, -1 is returned.
Public methodForEach
Performs the specified action on each item in this collection.
(Inherited from CollectionBaseT.)
Public methodGetEnumerator
Enumerates all of the items in the list, in order. The item at index 0 is enumerated first, then the item at index 1, and so on.
(Overrides CollectionBaseTGetEnumerator.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodIndexOf(T)
Finds the index of the first item in the list that is equal to item.
Public methodIndexOf(T, Int32)
Finds the index of the first item, in the range of items extending from index to the end, that is equal to item.
Public methodIndexOf(T, Int32, Int32)
Finds the index of the first item, in the range of count items starting from index, that is equal to item.
Public methodInsert
This method must be overridden by the derived class to insert a new item at the given index.
Public methodLastIndexOf(T)
Finds the index of the last item in the list that is equal to item.
Public methodLastIndexOf(T, Int32)
Finds the index of the last item, in the range of items extending from the beginning of the list to index, that is equal to item.
Public methodLastIndexOf(T, Int32, Int32)
Finds the index of the last item, in the range of count items ending at index, that is equal to item.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRange
Returns a view onto a sub-range of this list. Items are not copied; the returned IList<T> is simply a different view onto the same underlying items. Changes to this list are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the view, but insertions and deletions in the underlying list do not.
Public methodRemove
Searches the list for the first item that compares equal to item. If one is found, it is removed. Otherwise, the list is unchanged.
(Overrides CollectionBaseTRemove(T).)
Public methodRemoveAll
Removes all the items in the collection that satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodRemoveAt
This method must be overridden by the derived class to remove the item at the given index.
Public methodToArray
Creates an array of the correct size, and copies all the items in the collection into the array, by calling CopyTo.
(Inherited from CollectionBaseT.)
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.
(Inherited from CollectionBaseT.)
Public methodTrueForAll
Determines if all of the items in the collection satisfy the condition defined by predicate.
(Inherited from CollectionBaseT.)
Public methodTryFind
Finds the first item in the list that satisfies the condition defined by predicate.
Public methodTryFindLast
Finds the last item in the list that satisfies the condition defined by predicate.
Top
Properties
  NameDescription
Public propertyCount
The property must be overridden by the derived class to return the number of items in the list.
(Overrides CollectionBaseTCount.)
Public propertyItem
The indexer must be overridden by the derived class to get and set values of the list at a particular index.
Top
See Also