共用方式為


ServiceDescriptionFormatExtensionCollection.IndexOf(Object) 方法

定義

搜尋指定的 ServiceDescriptionFormatExtension,並傳回集合中第一個執行個體之以零起始的索引。

public:
 int IndexOf(System::Object ^ extension);
public int IndexOf (object extension);
member this.IndexOf : obj -> int
Public Function IndexOf (extension As Object) As Integer

參數

extension
Object

ServiceDescriptionFormatExtension,要在集合中搜尋它。

傳回

Int32

指定 ServiceDescriptionFormatExtension 的以零起始的索引;如果在集合中找不到此項目,則為 -1。

範例

// Get index of a 'myFormatExtension' object in collection.
Console::WriteLine( "Index of 'myFormatExtensionObject' is {0} in collection.", myCollection->IndexOf( myFormatExtensionObject ) );
// Get index of a 'myFormatExtension' object in collection.
Console.WriteLine("Index of 'myFormatExtensionObject' is "+
   "{0} in collection.",
   myCollection.IndexOf(myFormatExtensionObject).ToString());
' Get index of a 'myFormatExtension' object in collection.
Console.WriteLine("Index of 'myFormatExtensionObject' is " + _
     "{0} in collection.", myCollection.IndexOf(myFormatExtensionObject).ToString())

適用於