Searches for the specified object and returns the zero-based index of the first occurrence within the entire collection. Namespace: Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly: Microsoft.ComponentStudio.ComponentPlatformInterface (in microsoft.componentstudio.componentplatforminterface.dll)

Usage

Visual Basic
Public Class SomeType1
End Class
Public Class SomeType2
End Class
Dim value As SomeType2
Dim returnValue As Integer
Dim readOnlyKeyedCollection1 As ReadOnlyKeyedCollection(Of SomeType1, SomeType2)
returnValue = readOnlyKeyedCollection1.IndexOf(value)

Syntax

Visual Basic
Public NotOverridable Function IndexOf( _
		ByVal value As TValue _
) As Integer
C#
public sealed int IndexOf(
		TValue value
);
C++
public:
virtual int arbitrary-name(
		TValue value
) sealed = IndexOf;
J#
public final int IndexOf(
		TValue value
);
JScript
JScript does not support Generics.

Parameters

value

Object to locate in the collection.

Return Value

The zero-based index of the first occurrence of item within the entire collection, if found. If the object is not found, the return value is -1.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Vista, and Windows 2000

Target Platforms

See Also