CodeParameterDeclarationExpressionCollection.Contains Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Beolvas egy értéket, amely jelzi, hogy a gyűjtemény tartalmazza-e a megadott CodeParameterDeclarationExpressionértéket.
public:
bool Contains(System::CodeDom::CodeParameterDeclarationExpression ^ value);
public bool Contains(System.CodeDom.CodeParameterDeclarationExpression value);
member this.Contains : System.CodeDom.CodeParameterDeclarationExpression -> bool
Public Function Contains (value As CodeParameterDeclarationExpression) As Boolean
Paraméterek
A CodeParameterDeclarationExpression a gyűjteményben keresendő.
Válaszok
trueha a gyűjtemény tartalmazza a megadott objektumot; egyéb esetben. false
Példák
Az alábbi példa egy Contains adott CodeParameterDeclarationExpression objektum jelenlétének keresésére és a talált indexérték lekérésére használja a metódust.
// Tests for the presence of a CodeParameterDeclarationExpression
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression testParameter = new CodeParameterDeclarationExpression(typeof(int), "testIntArgument");
int itemIndex = -1;
if( collection.Contains( testParameter ) )
itemIndex = collection.IndexOf( testParameter );
' Tests for the presence of a CodeParameterDeclarationExpression
' in the collection, and retrieves its index if it is found.
Dim testParameter As New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument")
Dim itemIndex As Integer = -1
If collection.Contains(testParameter) Then
itemIndex = collection.IndexOf(testParameter)
End If