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 , 並將它加入InputGestureCollection至的RoutedCommandThe 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

取得這個 InputGestureInputGestureCollection 項目的數目。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)

判斷集合中是否有指定的 InputGestureDetermines 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 插入位於指定索引的這個 InputGestureCollectionInserts 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()

傳回代表目前物件的字串。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.

適用於

另請參閱