CodeCommentStatementCollection.Contains(CodeCommentStatement) Metoda

Definice

Získá hodnotu, která označuje, zda kolekce obsahuje zadaný CodeCommentStatement objekt.

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

Parametry

value
CodeCommentStatement

Vyhledá CodeCommentStatement se v kolekci.

Návraty

truepokud kolekce obsahuje zadaný objekt; v opačném případě . false

Příklady

Následující příklad používá metodu Contains k vyhledání přítomnosti konkrétního CodeCommentStatement objektu a získá hodnotu indexu, ve které byl nalezen.

// Tests for the presence of a CodeCommentStatement in the 
// collection, and retrieves its index if it is found.
CodeCommentStatement^ testComment = gcnew 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.
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

Platí pro

Viz také