CodeTypeReferenceCollection.Contains(CodeTypeReference) 方法

定义

获取一个值,该值指示集合是否包含指定的 CodeTypeReference

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

参数

value
CodeTypeReference

CodeTypeReference 搜索的集合。

返回

如果集合中包含 ,则为 否则为

示例

// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
    itemIndex = collection.IndexOf( testReference );
' Tests for the presence of a CodeTypeReference in the 
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
    itemIndex = collection.IndexOf(testReference)
End If

适用于

另请参阅