CastedListTFrom, TTo Class

表示强制转换后的强类型列表。

Definition

Namespace: QuickAdmin.Utils
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 1.1.6
C#
public class CastedList<TFrom, TTo> : IList<TTo>, 
	ICollection<TTo>, IEnumerable<TTo>, IEnumerable
Inheritance
object    CastedListTFrom, TTo
Implements
ICollectionTTo, IEnumerableTTo, IListTTo, IEnumerable

Type Parameters

TFrom
转换前的元素类型。
TTo
转换后的元素类型。

Remarks

注意元素类型将被从 TFrom 强制转换为 TTo,且不会做任何类型检查操作。 可通过 CastToListTFrom, TTo(IListTFrom) 扩展方法使用此类。 示例请参阅 SafelyCastedListTFrom, TTo 类。
条件允许时请优先使用 SafelyCastedList<TFrom, TTo>,因在本类内元素将被强制转换。

Constructors

CastedListTFrom, TTo 初始化转换后的强类型列表。

Properties

Public Properties

CountGets the number of elements contained in the ICollection.
FromList 源列表。
IsReadOnlyGets a value indicating whether the ICollectionT is read-only.
ItemGets or sets the element at the specified index.

Methods

Public Methods

AddAdds an item to the ICollectionT.
ClearRemoves all items from the ICollectionT.
ContainsDetermines whether the ICollectionT contains a specific value.
CopyToCopies the elements of the ICollectionT to an Array, starting at a particular Array index.
GetEnumeratorReturns an enumerator that iterates through a collection.
IndexOfDetermines the index of a specific item in the IListT.
InsertInserts an item to the IListT at the specified index.
RemoveRemoves the first occurrence of a specific object from the ICollectionT.
RemoveAtRemoves the IListT item at the specified index.

Explicit Interface Implementations

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.

See Also