The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CompilerErrorCollection::IndexOf Method (CompilerError^)
.NET Framework (current version)
Gets the index of the specified CompilerError object in the collection, if it exists in the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom.Compiler::CompilerError^
The CompilerError to locate.
Return Value
Type: System::Int32The index of the specified CompilerError in the CompilerErrorCollection, if found; otherwise, -1.
The following example searches for a specific CompilerError object and uses the IndexOf method to determine the index value at which it was found.
// Tests for the presence of a CompilerError in the // collection, and retrieves its index if it is found. CompilerError^ testError = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ); int itemIndex = -1; if ( collection->Contains( testError ) ) itemIndex = collection->IndexOf( testError );
.NET Framework
Available since 1.1
Available since 1.1
Show: