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