VectorKeyFrameCollection.IndexOf(VectorKeyFrame) 方法

定義

搜尋指定的 VectorKeyFrame,並傳回整個集合內第一個符合項目之以零為起始的索引。Searches for the specified VectorKeyFrame and returns the zero-based index of the first occurrence within the entire collection.

public:
 int IndexOf(System::Windows::Media::Animation::VectorKeyFrame ^ keyFrame);
public int IndexOf (System.Windows.Media.Animation.VectorKeyFrame keyFrame);
member this.IndexOf : System.Windows.Media.Animation.VectorKeyFrame -> int
Public Function IndexOf (keyFrame As VectorKeyFrame) As Integer

參數

keyFrame
VectorKeyFrame

要在集合中尋找的 VectorKeyFrameThe VectorKeyFrame to locate in the collection.

傳回

如有找到,則為整個集合內 keyFrame 的第一個符合項目之以零為起始的索引;否則為 -1The zero-based index of the first occurrence of keyFrame within the entire collection, if found; otherwise, -1.

備註

集合會從第一個主要畫面格開始向前搜尋, 並在最後一個主要畫面格結束。The collection is searched forward starting at the first key frame and ending at the last key frame.

這個方法會執行線性搜尋;因此, 平均執行時間與成正比CountThis method performs a linear search; therefore, the average execution time is proportional to Count. 也就是說, 這個方法是 O (n) 運算, 其中nCountThat is, this method is an O(n) operation, where n is Count.

這個方法會藉由呼叫Object.Equals來判斷是否相等。This method determines equality by calling Object.Equals.

適用於

另請參閱