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())

适用于