InputGestureCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 InputGesture 对象的有序集合。
public ref class InputGestureCollection sealed : System::Collections::IList
public sealed class InputGestureCollection : System.Collections.IList
type InputGestureCollection = class
interface IList
interface ICollection
interface IEnumerable
type InputGestureCollection = class
interface ICollection
interface IEnumerable
interface IList
Public NotInheritable Class InputGestureCollection
Implements IList
- 继承
-
InputGestureCollection
- 实现
示例
以下示例创建 并将其KeyGesture添加到 InputGestureCollection 的 。RoutedCommand
<Window.InputBindings>
<KeyBinding Key="B"
Modifiers="Control"
Command="ApplicationCommands.Open" />
</Window.InputBindings>
KeyGesture OpenCmdKeyGesture = new KeyGesture(
Key.B,
ModifierKeys.Control);
ApplicationCommands.Open.InputGestures.Add(OpenCmdKeyGesture);
Dim OpenCmdKeyGesture As New KeyGesture(Key.B, ModifierKeys.Control)
ApplicationCommands.Open.InputGestures.Add(OpenCmdKeyGesture)
构造函数
| InputGestureCollection() |
初始化 InputGestureCollection 类的新实例。 |
| InputGestureCollection(IList) |
使用指定 InputGestureCollection 中的元素初始化 IList 类的新实例。 |
属性
| Count |
获取此 InputGesture 中的 InputGestureCollection 项数。 |
| IsFixedSize |
获取一个值,该值指示此 InputGestureCollection 是否具有固定大小。 |
| IsReadOnly |
获取一个值,该值指示该 InputGestureCollection 是否为只读的。 默认值是 |
| IsSynchronized |
获取一个值,该值指示此 InputGestureCollection 是否是同步的(线程安全)。 |
| Item[Int32] |
获取或设置指定索引处的 InputGesture。 |
| SyncRoot |
获取可用于同步对此 InputGestureCollection 的访问的对象。 |
方法
| Add(InputGesture) |
将指定的 InputGesture 添加到此 InputGestureCollection。 |
| AddRange(ICollection) |
将指定的 ICollection 的元素添加到此 InputGestureCollection 的末尾。 |
| Clear() |
从 InputGestureCollection 中移除所有元素。 |
| Contains(InputGesture) |
确定指定的 InputGesture 是否在集合中。 |
| CopyTo(InputGesture[], Int32) |
将 InputGestureCollection 中的所有项复制到指定的一维数组(从目标数组的指定索引处开始)。 |
| Equals(Object) |
确定指定对象是否等于当前对象。 (继承自 Object) |
| GetEnumerator() |
获取一个循环访问此 InputGestureCollection 的枚举器。 |
| GetHashCode() |
作为默认哈希函数。 (继承自 Object) |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| IndexOf(InputGesture) |
在此 InputGesture 中搜索指定 InputGestureCollection 的第一个匹配项。 |
| Insert(Int32, InputGesture) |
将指定的 InputGesture 插入到此 InputGestureCollection 的指定索引位置处。 |
| MemberwiseClone() |
创建当前 Object 的浅表副本。 (继承自 Object) |
| Remove(InputGesture) |
从此 InputGesture 中移除指定的 InputGestureCollection 的第一个匹配项。 |
| RemoveAt(Int32) |
从此 InputGesture 的指定索引处移除指定的 InputGestureCollection。 |
| Seal() |
将此 InputGestureCollection 设置为只读。 |
| ToString() |
返回表示当前对象的字符串。 (继承自 Object) |
显式接口实现
| ICollection.CopyTo(Array, Int32) |
有关此成员的说明,请参见 CopyTo(Array, Int32)。 |
| IList.Add(Object) |
有关此成员的说明,请参见 Add(Object)。 |
| IList.Contains(Object) |
有关此成员的说明,请参见 Contains(Object)。 |
| IList.IndexOf(Object) |
有关此成员的说明,请参见 IndexOf(Object)。 |
| IList.Insert(Int32, Object) |
有关此成员的说明,请参见 Insert(Int32, Object)。 |
| IList.Item[Int32] |
有关此成员的说明,请参见 Item[Int32]。 |
| IList.Remove(Object) |
有关此成员的说明,请参见 Remove(Object)。 |
扩展方法
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |