Table of Contents

Class BaseList<TItem>

Namespace
Ecng.Collections
Assembly
Ecng.Collections.dll

Represents a base class for a strongly-typed list of items.

public abstract class BaseList<TItem> : BaseCollection<TItem, IList<TItem>>, INotifyList<TItem>, INotifyCollection<TItem>, IList<TItem>, ICollection<TItem>, IEnumerable<TItem>, IList, ICollection, IEnumerable

Type Parameters

TItem

The type of elements in the list.

Inheritance
BaseCollection<TItem, IList<TItem>>
BaseList<TItem>
Implements
IList<TItem>
Inherited Members
Extension Methods

Constructors

BaseList()

Initializes a new instance of the BaseList<TItem> class with an empty inner list.

protected BaseList()

BaseList(IList<TItem>)

Represents a base class for a strongly-typed list of items.

protected BaseList(IList<TItem> innerList)

Parameters

innerList IList<TItem>

Methods

IndexOf(TItem)

Determines the index of a specific item in the inner list.

public override int IndexOf(TItem item)

Parameters

item TItem

The item to locate in the list.

Returns

int

The index of the item if found in the list; otherwise, -1.

OnGetItem(int)

Retrieves the item at the specified index from the inner list.

protected override TItem OnGetItem(int index)

Parameters

index int

The zero-based index of the item to retrieve.

Returns

TItem

The item at the specified index.

OnInsert(int, TItem)

Inserts an item into the inner list at the specified index.

protected override void OnInsert(int index, TItem item)

Parameters

index int

The zero-based index at which the item should be inserted.

item TItem

The item to insert into the list.

OnRemoveAt(int)

Removes the item at the specified index from the inner list.

protected override void OnRemoveAt(int index)

Parameters

index int

The zero-based index of the item to remove.