CodeTypeReferenceCollection.Contains(CodeTypeReference) Méthode

Définition

Obtient une valeur indiquant si la collection comporte le CodeTypeReference spécifié.

public:
 bool Contains(System::CodeDom::CodeTypeReference ^ value);
public bool Contains (System.CodeDom.CodeTypeReference value);
member this.Contains : System.CodeDom.CodeTypeReference -> bool
Public Function Contains (value As CodeTypeReference) As Boolean

Paramètres

value
CodeTypeReference

CodeTypeReference à rechercher dans la collection.

Retours

true si CodeTypeReference est contenu dans la collection ; sinon false.

Exemples

// Tests for the presence of a CodeTypeReference in the 
// collection, and retrieves its index if it is found.
CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
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.
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

S’applique à

Voir aussi