This documentation is archived and is not being maintained.
OperationCollection.IndexOf Method
.NET Framework 1.1
Searches for the specified Operation and returns the zero-based index of the first occurrence within the collection.
[Visual Basic] Public Function IndexOf( _ ByVal operation As Operation _ ) As Integer [C#] public int IndexOf( Operation operation ); [C++] public: int IndexOf( Operation* operation ); [JScript] public function IndexOf( operation : Operation ) : int;
Parameters
- operation
- The Operation for which to search in the collection.
Return Value
A 32-bit signed integer.
Example
[Visual Basic, C#, C++] The following example demonstrates the use of the IndexOf method.
[Visual Basic] If myOperationCollection.Contains(myOperation) = True Then Console.WriteLine("The index of the added 'myOperation' " + _ "operation is : " + _ myOperationCollection.IndexOf(myOperation).ToString) End If [C#] if(myOperationCollection.Contains(myOperation) == true) { Console.WriteLine("The index of the added 'myOperation' " + "operation is : " + myOperationCollection.IndexOf(myOperation)); } [C++] if(myOperationCollection->Contains(myOperation) == true) { Console::WriteLine(S"The index of the added 'myOperation' operation is : {0}", __box(myOperationCollection->IndexOf(myOperation))); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
OperationCollection Class | OperationCollection Members | System.Web.Services.Description Namespace
Show: