CodeCommentStatementCollection.Contains(CodeCommentStatement) 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 une valeur qui indique si la collection contient l’objet spécifié CodeCommentStatement .
public:
bool Contains(System::CodeDom::CodeCommentStatement ^ value);
public bool Contains(System.CodeDom.CodeCommentStatement value);
member this.Contains : System.CodeDom.CodeCommentStatement -> bool
Public Function Contains (value As CodeCommentStatement) As Boolean
Paramètres
- value
- CodeCommentStatement
À CodeCommentStatement rechercher dans la collection.
Retours
true si la collection contient l’objet spécifié ; sinon, false.
Exemples
L’exemple suivant utilise la Contains méthode pour rechercher la présence d’un objet spécifique CodeCommentStatement et obtenir la valeur d’index à laquelle elle a été trouvée.
// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement testComment = new CodeCommentStatement("Test comment");
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
' Tests for the presence of a CodeCommentStatement in the
' collection, and retrieves its index if it is found.
Dim testComment As New CodeCommentStatement("Test comment")
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If