CodeCommentStatementCollection.Contains(CodeCommentStatement) Metodo

Definizione

Ottiene un valore che indica se l'insieme contiene l'oggetto CodeCommentStatement specificato.

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

Parametri

value
CodeCommentStatement

Oggetto CodeCommentStatement da cercare nell'insieme.

Restituisce

true se l'insieme contiene l'oggetto specificato; in caso contrario, false.

Esempio

Nell'esempio seguente viene utilizzato il Contains metodo per cercare la presenza di un oggetto specifico CodeCommentStatement e ottiene il valore di indice in corrispondenza del quale è stato trovato.

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

Si applica a

Vedi anche