CodeTypeReferenceCollection.IndexOf(CodeTypeReference) Methode

Definition

Ruft den Index in der Auflistung der angegebenen CodeTypeReference, wenn er in der Auflistung vorhanden ist.

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

Parameter

value
CodeTypeReference

Der CodeTypeReference zu suchende In der Sammlung.

Gibt zurück

Der Index der in der Auflistung angegebenen CodeTypeReference , falls gefunden; andernfalls -1.

Beispiele

// 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

Gilt für:

Weitere Informationen