CodeParameterDeclarationExpressionCollection.Contains 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个值,该值指示集合是否包含指定的 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
参数
要在该集合中搜索的 CodeParameterDeclarationExpression。
返回
当集合包含指定的对象时为 true
;否则为 false
。
示例
以下示例使用 Contains 方法搜索特定 CodeParameterDeclarationExpression 对象的存在,并获取找到该对象的索引值。
// Tests for the presence of a CodeParameterDeclarationExpression
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression^ testParameter = gcnew CodeParameterDeclarationExpression( int::typeid,"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.
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