CodeCommentStatementCollection.Contains(CodeCommentStatement) Methode

Definitie

Hiermee wordt een waarde opgehaald die aangeeft of de verzameling het opgegeven CodeCommentStatement object bevat.

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

Parameters

value
CodeCommentStatement

De CodeCommentStatement te zoeken in de verzameling.

Retouren

true als de verzameling het opgegeven object bevat; anders, false.

Voorbeelden

In het volgende voorbeeld wordt de Contains methode gebruikt om te zoeken naar de aanwezigheid van een specifiek CodeCommentStatement object en wordt de indexwaarde opgehaald waarop het is gevonden.

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

Van toepassing op

Zie ook