ListView.CheckedIndexCollection 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示包含列表视图控件中已选中项的索引的集合。
public: ref class ListView::CheckedIndexCollection : System::Collections::IList
	public 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
	[<System.ComponentModel.ListBindable(false)>]
type ListView.CheckedIndexCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
	Public Class ListView.CheckedIndexCollection
Implements IList
		- 继承
 - 
				ListView.CheckedIndexCollection
 
- 属性
 
- 实现
 
注解
将 ListView.CheckedIndexCollection 索引存储在控件中的 ListView 已检查项。 Items can be checked only if the CheckBoxes property of the ListView control is set to true. 存储在其中的ListView.CheckedIndexCollection索引是索引位置。ListView.ListViewItemCollection 存储 ListView.ListViewItemCollection 控件中显示的 ListView 所有项。
下表是一个示例,说明如何在ListView.ListViewItemCollection示例ListView控件中存储项ListView及其检查状态。
| 索引 | Item | ListView 中的选中状态 | 
|---|---|---|
| 0 | Item1 | 未选中 | 
| 1 | Item2 | 已选中 | 
| 2 | Item3 | 未选中 | 
| 3 | Item4 | 已选中 | 
| 4 | Item5 | 已选中 | 
根据 ListView.ListViewItemCollection 上表中的示例,下表演示了该示例的显示方式 ListView.CheckedIndexCollection 。
| 索引 | ListViewItemCollection 中已检查项的索引 | 
|---|---|
| 0 | 1 | 
| 1 | 3 | 
| 2 | 4 | 
可以使用此类的属性和方法通过集合执行各种任务。 通过此方法 Contains ,可以确定索引 ListView.ListViewItemCollection 位置是否是存储在其中的 ListView.CheckedIndexCollection索引之一。 知道项在集合中后,可以使用 IndexOf 该方法确定索引在集合 ListView.CheckedIndexCollection中的位置。
构造函数
| ListView.CheckedIndexCollection(ListView) |  
		 初始化 ListView.CheckedIndexCollection 类的新实例。  | 
        	
属性
| Count |  
		 获取集合中的项数。  | 
        	
| IsReadOnly |  
		 获取一个值,该值指示集合是否为只读。  | 
        	
| Item[Int32] |  
		 获取集合中指定索引处的索引值。  | 
        	
方法
| Contains(Int32) |  
		 确定指定索引是否位于集合中。  | 
        	
| Equals(Object) | 
		   确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetEnumerator() |  
		 返回一个可用于循环访问选定索引集合的枚举数。  | 
        	
| GetHashCode() | 
		   作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		   获取当前实例的 Type。 (继承自 Object) | 
        	
| IndexOf(Int32) |  
		 从列表视图控件的 ListView.CheckedIndexCollection 返回指定索引的 ListView.ListViewItemCollection 中的索引。  | 
        	
| MemberwiseClone() | 
		   创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		   返回表示当前对象的字符串。 (继承自 Object) | 
        	
显式接口实现
| ICollection.CopyTo(Array, Int32) |  
		 将选中项索引的集合复制到数组中。  | 
        	
| ICollection.IsSynchronized |  
		 获取一个值,该值指示对集合的访问是否为同步的(线程安全)。  | 
        	
| ICollection.SyncRoot |  
		 获取可用于同步控件集合访问的对象。  | 
        	
| IList.Add(Object) |  
		 向集合中添加一项。  | 
        	
| IList.Clear() |  
		 从集合中移除所有项。  | 
        	
| IList.Contains(Object) |  
		 检查是否选中了与 ListViewItem 对应的索引。  | 
        	
| IList.IndexOf(Object) |  
		 返回指定对象在 ListView.CheckedIndexCollection 中的索引。  | 
        	
| IList.Insert(Int32, Object) |  
		 将某个项插入到集合中的指定索引处。  | 
        	
| IList.IsFixedSize |  
		 获取一个值,该值指示 ListView.CheckedIndexCollection 是否具有固定大小。  | 
        	
| IList.Item[Int32] |  
		 获取或设置 ListView.CheckedIndexCollection 中的对象。  | 
        	
| IList.Remove(Object) |  
		 从集合中移除某项的第一个匹配项。  | 
        	
| IList.RemoveAt(Int32) |  
		 移除集合中指定索引处的项。  | 
        	
扩展方法
| Cast<TResult>(IEnumerable) |  
		 将 IEnumerable 的元素强制转换为指定的类型。  | 
        	
| OfType<TResult>(IEnumerable) |  
		 根据指定类型筛选 IEnumerable 的元素。  | 
        	
| AsParallel(IEnumerable) |  
		 启用查询的并行化。  | 
        	
| AsQueryable(IEnumerable) |  
		 将 IEnumerable 转换为 IQueryable。  |