InputGestureCollection 类

定义

表示 InputGesture 对象的有序集合。Represents an ordered collection of InputGesture objects.

public ref class InputGestureCollection sealed : System::Collections::IList
public sealed class InputGestureCollection : System.Collections.IList
type InputGestureCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class InputGestureCollection
Implements IList
继承
InputGestureCollection
实现

示例

下面的示例创建一个KeyGesture , 并将其添加InputGestureCollectionRoutedCommand的。The following example creates a KeyGesture and adds it to the InputGestureCollection of a 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 类的新实例。Initializes a new instance of the InputGestureCollection class.

InputGestureCollection(IList)

使用指定 InputGestureCollection 中的元素初始化 IList 类的新实例。Initializes a new instance of the InputGestureCollection class using the elements in the specified IList.

属性

Count

获取此 InputGesture 中的 InputGestureCollection 项数。Gets the number of InputGesture items in this InputGestureCollection.

IsFixedSize

获取一个值,该值指示此 InputGestureCollection 是否具有固定大小。Gets a value that indicates whether this InputGestureCollection has a fixed size.

IsReadOnly

获取一个值,该值指示此 InputGestureCollection 是否为只读。Gets a value that indicates whether this InputGestureCollection is read-only. 默认值为 falseThe default value is false.

IsSynchronized

获取一个值,该值指示此 InputGestureCollection 是否是同步的(线程安全)。Gets a value that indicates whether this InputGestureCollection is synchronized (thread safe).

Item[Int32]

获取或设置指定索引处的 InputGestureGets or set the InputGesture at the specified index.

SyncRoot

获取可用于同步对此 InputGestureCollection 的访问的对象。Gets an object that can be used to synchronize access to this InputGestureCollection.

方法

Add(InputGesture)

将指定的 InputGesture 添加到此 InputGestureCollectionAdds the specified InputGesture to this InputGestureCollection.

AddRange(ICollection)

将指定的 ICollection 的元素添加到此 InputGestureCollection 的末尾。Adds the elements of the specified ICollection to the end of this InputGestureCollection.

Clear()

InputGestureCollection 中移除所有元素。Removes all elements from the InputGestureCollection.

Contains(InputGesture)

确定指定的 InputGesture 是否在集合中。Determines whether the specified InputGesture is in the collection.

CopyTo(InputGesture[], Int32)

InputGestureCollection 中的所有项复制到指定的一维数组(从目标数组的指定索引处开始)。Copies all of the items in the InputGestureCollection to the specified one-dimensional array, starting at the specified index of the target array.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

获取一个循环访问此 InputGestureCollection 的枚举器。Gets an enumerator that iterates through this InputGestureCollection.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
IndexOf(InputGesture)

在此 InputGesture 中搜索指定 InputGestureCollection 的第一个匹配项。Searches for the first occurrence of the specified InputGesture in this InputGestureCollection.

Insert(Int32, InputGesture)

将指定的 InputGesture 插入到此 InputGestureCollection 的指定索引位置处。Inserts the specified InputGesture into this InputGestureCollection at the specified index.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Remove(InputGesture)

从此 InputGesture 中移除指定的 InputGestureCollection 的第一个匹配项。Removes the first occurrence of the specified InputGesture from this InputGestureCollection.

RemoveAt(Int32)

从此 InputGesture 的指定索引处移除指定的 InputGestureCollectionRemoves the specified InputGesture at the specified index of this InputGestureCollection.

Seal()

将此 InputGestureCollection 设置为只读。Sets this InputGestureCollection to read-only.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(Array, Int32)For a description of this member, see CopyTo(Array, Int32).

IList.Add(Object)

有关此成员的说明,请参见 Add(Object)For a description of this member, see Add(Object).

IList.Contains(Object)

有关此成员的说明,请参见 Contains(Object)For a description of this member, see Contains(Object).

IList.IndexOf(Object)

有关此成员的说明,请参见 IndexOf(Object)For a description of this member, see IndexOf(Object).

IList.Insert(Int32, Object)

有关此成员的说明,请参见 Insert(Int32, Object)For a description of this member, see Insert(Int32, Object).

IList.Item[Int32]

有关此成员的说明,请参见 Item[Int32]For a description of this member, see Item[Int32].

IList.Remove(Object)

有关此成员的说明,请参见 Remove(Object)For a description of this member, see Remove(Object).

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅