ListView.CheckedIndexCollection ListView.CheckedIndexCollection ListView.CheckedIndexCollection ListView.CheckedIndexCollection Class

定義

表示包含清單檢視控制項中所核取項目索引的集合。Represents the collection containing the indexes to the checked items in a list view control.

public: ref class ListView::CheckedIndexCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class ListView.CheckedIndexCollection : System.Collections.IList
type ListView.CheckedIndexCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ListView.CheckedIndexCollection
Implements IList
繼承
ListView.CheckedIndexCollectionListView.CheckedIndexCollectionListView.CheckedIndexCollectionListView.CheckedIndexCollection
屬性
實作

備註

AListView.CheckedIndexCollection存放區索引中的選取項目以ListView控制項。A ListView.CheckedIndexCollection stores the indexes to the checked items in a ListView control. 可以選取項目,只有當CheckBoxes的屬性ListView控制設為 trueItems can be checked only if the CheckBoxes property of the ListView control is set to true. 索引儲存在ListView.CheckedIndexCollection內的索引放置ListView.ListViewItemCollectionThe indexes stored in the ListView.CheckedIndexCollection are index positions within the ListView.ListViewItemCollection. ListView.ListViewItemCollection存放區中顯示的所有項目ListView控制項。The ListView.ListViewItemCollection stores all items displayed in the ListView control.

下表會如何的範例ListView.ListViewItemCollection儲存的項目ListView以及其在範例中的核取狀態ListView控制項。The following table is an example of how the ListView.ListViewItemCollection stores the items of the ListView as well as their checked states in an example ListView control.

索引Index 項目Item 檢查在 ListView 中的狀態Checked state in the ListView
00 Item1Item1 未選取Unchecked
11 Item2Item2 已核取Checked
22 Item3Item3 未選取Unchecked
33 Item4Item4 已核取Checked
44 Item5Item5 已核取Checked

根據ListView.ListViewItemCollection上表中的範例下, 表會示範如何ListView.CheckedIndexCollection會出現。Based on the ListView.ListViewItemCollection example in the previous table, the following table demonstrates how the ListView.CheckedIndexCollection would appear.

索引Index ListViewItemCollection 中的核取項目的索引Index of checked item in ListViewItemCollection
00 11
11 33
22 44

您可以使用這個類別的方法與屬性來執行各種工作的集合。You can use the properties and methods of this class to perform a variety of tasks with the collection. Contains方法可讓您判斷是否從索引位置ListView.ListViewItemCollection是儲存在索引的其中一個ListView.CheckedIndexCollectionThe Contains method enables you to determine whether an index position from the ListView.ListViewItemCollection is one of the indexes stored in the ListView.CheckedIndexCollection. 一旦您知道的項目是集合中,您可以使用IndexOf方法,以判斷中的索引位置ListView.CheckedIndexCollectionOnce you know that the item is in the collection, you can use the IndexOf method to determine the position of the index in the ListView.CheckedIndexCollection.

建構函式

ListView.CheckedIndexCollection(ListView) ListView.CheckedIndexCollection(ListView) ListView.CheckedIndexCollection(ListView) ListView.CheckedIndexCollection(ListView)

初始化 ListView.CheckedIndexCollection 類別的新執行個體。Initializes a new instance of the ListView.CheckedIndexCollection class.

屬性

Count Count Count Count

取得集合中的項目數目。Gets the number of items in the collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,表示集合是否為唯讀。Gets a value indicating whether the collection is read-only.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得集合中位於指定索引處的索引值。Gets the index value at the specified index within the collection.

方法

Contains(Int32) Contains(Int32) Contains(Int32) Contains(Int32)

判斷指定的索引是否位於集合中。Determines whether the specified index is located in the collection.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回用於逐一查看選取索引集合的列舉值。Returns an enumerator that can be used to iterate through the checked index collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Int32) IndexOf(Int32) IndexOf(Int32) IndexOf(Int32)

從清單檢視控制項的 ListView.CheckedIndexCollection 傳回在指定索引之 ListView.ListViewItemCollection 中的索引。Returns the index within the ListView.CheckedIndexCollection of the specified index from the ListView.ListViewItemCollection of the list view control.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

將核取項目索引的集合複製到陣列中。Copies the collection of checked-item indexes into an array.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

取得可用來對控制項集合進行同步 (Synchronize) 存取的物件。Gets an object that can be used to synchronize access to the collection of controls.

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

將項目加入至集合。Adds an item to the collection.

IList.Clear() IList.Clear() IList.Clear() IList.Clear()

移除集合的所有項目。Removes all items from the collection.

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

檢查與是否已核取與 ListViewItem 對應的索引。Checks whether the index corresponding with the ListViewItem is checked.

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

傳回 ListView.CheckedIndexCollection 中指定之物件的索引。Returns the index of the specified object in the ListView.CheckedIndexCollection.

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

在指定的索引位置,插入項目至集合之中。Inserts an item into the collection at a specified index.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

取得值,指出 ListView.CheckedIndexCollection 是否有固定的大小。Gets a value indicating whether the ListView.CheckedIndexCollection has a fixed size.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

取得或設定 ListView.CheckedIndexCollection 中的物件。Gets or sets an object in the ListView.CheckedIndexCollection.

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

從集合移除第一個項目。Removes the first occurrence of an item from the collection.

IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)

從指定索引的集合移除項目。Removes an item from the collection at a specified index.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱