CodeAttributeArgumentCollection.Contains(CodeAttributeArgument) Metodo

Definizione

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

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

Parametri

value
CodeAttributeArgument

Oggetto CodeAttributeArgument da individuare nell'insieme.

Valori restituiti

true se la raccolta 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 CodeAttributeArgument in un CodeAttributeArgumentCollection e ottiene il valore di indice in corrispondenza del quale è stato trovato.

// Tests for the presence of a CodeAttributeArgument
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument testArgument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
int itemIndex = -1;
if( collection.Contains( testArgument ) )
    itemIndex = collection.IndexOf( testArgument );
' Tests for the presence of a CodeAttributeArgument in 
' the collection, and retrieves its index if it is found.
Dim testArgument As New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True))
Dim itemIndex As Integer = -1
If collection.Contains(testArgument) Then
    itemIndex = collection.IndexOf(testArgument)
End If

Si applica a