次の方法で共有


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

戻り値

CodeTypeReference がコレクションに含まれている場合は true。それ以外の場合は false

// Tests for the presence of a CodeTypeReference in the 
// collection, and retrieves its index if it is found.
CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
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.
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

適用対象

こちらもご覧ください