CodeExpressionCollection.Contains(CodeExpression) CodeExpressionCollection.Contains(CodeExpression) CodeExpressionCollection.Contains(CodeExpression) CodeExpressionCollection.Contains(CodeExpression) Method

Definizione

Ottiene un valore che indica se l'insieme contiene l'oggetto CodeExpression specificato.Gets a value that indicates whether the collection contains the specified CodeExpression object.

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

Parametri

value
CodeExpression CodeExpression CodeExpression CodeExpression

Oggetto CodeExpression da individuare nell'insieme.The CodeExpression object to locate in the collection.

Restituisce

true se l'insieme contiene l'oggetto specificato; in caso contrario, false.true if the collection contains the specified object; otherwise, false.

Esempi

Nell'esempio seguente viene utilizzato Contains il metodo per cercare la presenza di un oggetto CodeExpression specifico e ottiene il valore di indice in corrispondenza del quale è stato trovato.The following example uses the Contains method to search for the presence of a specific CodeExpression object and gets the index value at which it was found.

// Tests for the presence of a CodeExpression in the 
// collection, and retrieves its index if it is found.
CodeExpression^ testComment = gcnew CodePrimitiveExpression( true );
int itemIndex = -1;
if ( collection->Contains( testComment ) )
   itemIndex = collection->IndexOf( testComment );
// Tests for the presence of a CodeExpression in the 
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(true);
int itemIndex = -1;
if( collection.Contains( testComment ) )
    itemIndex = collection.IndexOf( testComment );
' Tests for the presence of a CodeExpression in the 
' collection, and retrieves its index if it is found.
Dim testComment = New CodePrimitiveExpression(True)
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
    itemIndex = collection.IndexOf(testComment)
End If

Si applica a

Vedi anche