Int16KeyFrameCollection.IndexOf(Int16KeyFrame) 方法

定义

在整个集合中搜索指定的 Int16KeyFrame,并返回第一个匹配项的从零开始的索引。Searches for the specified Int16KeyFrame and returns the zero-based index of the first occurrence within the entire collection.

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

参数

keyFrame
Int16KeyFrame

要在集合中查找的 Int16KeyFrameThe Int16KeyFrame 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.

适用于

另请参阅