CodeCatchClauseCollection.Contains(CodeCatchClause) メソッド

定義

指定した CodeCatchClause オブジェクトがコレクションに含まれているかどうかを示す値を取得します。

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

パラメーター

value
CodeCatchClause

コレクション内で検索する CodeCatchClause オブジェクト。

戻り値

コレクションに指定したオブジェクトが格納されている場合は true。それ以外の場合は false

次の例では、 メソッドを Contains 使用して特定 CodeCatchClause のインスタンスの存在を検索し、検出されたインデックス値を取得します。

// Tests for the presence of a CodeCatchClause in the 
// collection, and retrieves its index if it is found.
CodeCatchClause^ testClause = gcnew CodeCatchClause( "e" );
int itemIndex = -1;
if ( collection->Contains( testClause ) )
   itemIndex = collection->IndexOf( testClause );
// Tests for the presence of a CodeCatchClause in the
// collection, and retrieves its index if it is found.
CodeCatchClause testClause = new CodeCatchClause("e");
int itemIndex = -1;
if( collection.Contains( testClause ) )
    itemIndex = collection.IndexOf( testClause );
' Tests for the presence of a CodeCatchClause in the 
' collection, and retrieves its index if it is found.
Dim testClause As New CodeCatchClause("e")
Dim itemIndex As Integer = -1
If collection.Contains(testClause) Then
    itemIndex = collection.IndexOf(testClause)
End If

適用対象

こちらもご覧ください