Gets the index of the specified CodeCommentStatement object in the collection, if it exists in the collection.
Assembly: System (in System.dll)
The following example searches for the presence of a specific CodeCommentStatement object and uses the method to get the index value at which it was found.
// Tests for the presence of a CodeCommentStatement in the // collection, and retrieves its index if it is found. CodeCommentStatement testComment = new CodeCommentStatement("Test comment"); int itemIndex = -1; if( collection.Contains( testComment ) ) itemIndex = collection.IndexOf( testComment );