CommandCollection 类

继承层次结构

System.Object
  System.Collections.ObjectModel.Collection<ICommand>
    System.Collections.ObjectModel.ObservableCollection<ICommand>
      Microsoft.TeamFoundation.Controls.WPF.Commands.CommandCollection

命名空间:  Microsoft.TeamFoundation.Controls.WPF.Commands
程序集:  Microsoft.TeamFoundation.Controls(在 Microsoft.TeamFoundation.Controls.dll 中)

语法

声明
Public Class CommandCollection _
    Inherits ObservableCollection(Of ICommand)
public class CommandCollection : ObservableCollection<ICommand>

CommandCollection 类型公开以下成员。

构造函数

  名称 说明
公共方法 CommandCollection

页首

属性

  名称 说明
公共属性 Count 获取 Collection<T> 中实际包含的元素数。 (继承自 Collection<ICommand>。)
公共属性 Item 获取或设置位于指定索引处的元素。 (继承自 Collection<ICommand>。)
受保护的属性 Items 获取 Collection<T> 周围的 IList<T> 包装。 (继承自 Collection<ICommand>。)

页首

方法

  名称 说明
公共方法 Add 将对象添加到 Collection<T> 的结尾处。 (继承自 Collection<ICommand>。)
受保护的方法 BlockReentrancy 不允许可重入的更改此集合的尝试。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 CheckReentrancy 检查可重入的更改此集合的尝试。 (继承自 ObservableCollection<ICommand>。)
公共方法 Clear Collection<T> 中移除所有元素。 (继承自 Collection<ICommand>。)
受保护的方法 ClearItems 从集合中移除所有项。 (继承自 ObservableCollection<ICommand>。)
公共方法 Contains 确定某元素是否在 Collection<T> 中。 (继承自 Collection<ICommand>。)
公共方法 CopyTo 从目标数组的指定索引处开始将整个 Collection<T> 复制到兼容的一维 Array。 (继承自 Collection<ICommand>。)
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetEnumerator 返回循环访问 Collection<T> 的枚举数。 (继承自 Collection<ICommand>。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IndexOf 搜索指定的对象,并返回整个 Collection<T> 中第一个匹配项的从零开始的索引。 (继承自 Collection<ICommand>。)
公共方法 Insert 将元素插入 Collection<T> 的指定索引处。 (继承自 Collection<ICommand>。)
受保护的方法 InsertItem 将一项插入集合中指定索引处。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 Move 将指定索引处的项移至集合中的新位置。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 MoveItem 将指定索引处的项移至集合中的新位置。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 OnCollectionChanged 引发带有提供的参数的 CollectionChanged 事件。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 OnPropertyChanged 引发带有提供的参数的 PropertyChanged 事件。 (继承自 ObservableCollection<ICommand>。)
公共方法 Remove Collection<T> 中移除特定对象的第一个匹配项。 (继承自 Collection<ICommand>。)
公共方法 RemoveAt 移除 Collection<T> 的指定索引处的元素。 (继承自 Collection<ICommand>。)
受保护的方法 RemoveItem 移除集合中指定索引处的项。 (继承自 ObservableCollection<ICommand>。)
受保护的方法 SetItem 替换指定索引处的元素。 (继承自 ObservableCollection<ICommand>。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

事件

  名称 说明
公共事件 CollectionChanged 在添加、移除、更改或移动项或者在刷新整个列表时发生。 (继承自 ObservableCollection<ICommand>。)
受保护的事件 PropertyChanged 在更改属性值时发生。 (继承自 ObservableCollection<ICommand>。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 IList.Add 将某项添加到 IList 中。 (继承自 Collection<ICommand>。)
显式接口实现私有方法 IList.Contains 确定 IList 是否包含特定值。 (继承自 Collection<ICommand>。)
显式接口实现私有方法 ICollection.CopyTo 从特定的 Array 索引处开始,将 ICollection 的元素复制到一个 Array 中。 (继承自 Collection<ICommand>。)
显式接口实现私有方法 IEnumerable.GetEnumerator 返回一个循环访问集合的枚举数。 (继承自 Collection<ICommand>。)
显式接口实现私有方法 IList.IndexOf 确定 IList 中特定项的索引。 (继承自 Collection<ICommand>。)
显式接口实现私有方法 IList.Insert 将某项插入 IList 中指定的索引处。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 IList.IsFixedSize 获取一个值,该值指示 IList 是否具有固定大小。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 ICollection<T>.IsReadOnly 获取一个值,该值指示 ICollection<T> 是否为只读。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 IList.IsReadOnly 获取一个值,该值指示 IList 是否为只读。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 ICollection.IsSynchronized 获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 IList.Item 获取或设置位于指定索引处的元素。 (继承自 Collection<ICommand>。)
显式接口实现私有事件 INotifyPropertyChanged.PropertyChanged 在更改属性值时发生。 (继承自 ObservableCollection<ICommand>。)
显式接口实现私有方法 IList.Remove IList 中移除特定对象的第一个匹配项。 (继承自 Collection<ICommand>。)
显式接口实现私有属性 ICollection.SyncRoot 获取可用于同步对 ICollection 的访问的对象。 (继承自 Collection<ICommand>。)

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.TeamFoundation.Controls.WPF.Commands 命名空间