CodeTypeReferenceCollection.IndexOf(CodeTypeReference) Methode

Definitie

Hiermee haalt u de index op in de verzameling van de opgegeven CodeTypeReference, als deze in de verzameling bestaat.

public:
 int IndexOf(System::CodeDom::CodeTypeReference ^ value);
public int IndexOf(System.CodeDom.CodeTypeReference value);
member this.IndexOf : System.CodeDom.CodeTypeReference -> int
Public Function IndexOf (value As CodeTypeReference) As Integer

Parameters

value
CodeTypeReference

De CodeTypeReference te vinden in de verzameling.

Retouren

De index van de opgegeven CodeTypeReference in de verzameling, indien gevonden; anders -1.

Voorbeelden

// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
    itemIndex = collection.IndexOf( testReference );
' Tests for the presence of a CodeTypeReference in the 
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
    itemIndex = collection.IndexOf(testReference)
End If

Van toepassing op

Zie ook