DoubleKeyFrameCollection.IndexOf(DoubleKeyFrame) 方法

定義

搜尋指定的 DoubleKeyFrame,並傳回在整個集合中第一個符合項目之以零為起始的索引。

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

參數

keyFrame
DoubleKeyFrame

要在集合中尋找的 DoubleKeyFrame

傳回

Int32

如有找到,則為整個集合內 keyFrame 的第一個符合項目之以零為起始的索引,否則為 -1

備註

集合會從第一個主要畫面格開始向前搜尋,最後一個主要畫面格結束。

此方法會執行線性搜尋;因此,平均執行時間會與 的值 Count 成正比。 也就是說,這個方法是 o (n) 作業,其中 n 等於 Count

這個方法會呼叫 Object.Equals 來判斷相等。

適用於

另請參閱