Rotation3DKeyFrameCollection.IndexOf(Rotation3DKeyFrame) Rotation3DKeyFrameCollection.IndexOf(Rotation3DKeyFrame) Rotation3DKeyFrameCollection.IndexOf(Rotation3DKeyFrame) Rotation3DKeyFrameCollection.IndexOf(Rotation3DKeyFrame) Method

定义

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

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

参数

keyFrame
Rotation3DKeyFrame Rotation3DKeyFrame Rotation3DKeyFrame Rotation3DKeyFrame

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

适用于

另请参阅