CodeParameterDeclarationExpressionCollection.Contains Метод

Определение

Возвращает значение, указывающее, содержит ли коллекция указанный CodeParameterDeclarationExpressionобъект.

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

Параметры

Возвращаемое значение

true Значение , если коллекция содержит указанный объект; falseв противном случае .

Примеры

В следующем примере метод используется Contains для поиска присутствия определенного CodeParameterDeclarationExpression объекта и получения значения индекса, по которому он был найден.

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

Применяется к

См. также раздел