CodeTypeReferenceCollection.IndexOf(CodeTypeReference) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient l’index dans la collection de l’objet spécifié CodeTypeReference, s’il existe dans la collection.
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
Paramètres
- value
- CodeTypeReference
À CodeTypeReference localiser dans la collection.
Retours
Index du fichier spécifié CodeTypeReference dans la collection s’il est trouvé ; sinon, -1.
Exemples
// 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