CodeCatchClauseCollection.IndexOf(CodeCatchClause) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コレクション内に指定した CodeCatchClause オブジェクトが存在する場合は、そのオブジェクトのインデックスを取得します。
public:
int IndexOf(System::CodeDom::CodeCatchClause ^ value);
public int IndexOf(System.CodeDom.CodeCatchClause value);
member this.IndexOf : System.CodeDom.CodeCatchClause -> int
Public Function IndexOf (value As CodeCatchClause) As Integer
パラメーター
- value
- CodeCatchClause
コレクション内で検索する CodeCatchClause オブジェクト。
返品
コレクション内の指定したオブジェクトのインデックス (見つかった場合)。それ以外の場合は -1。
例
次の例では、特定の CodeCatchClause オブジェクトの存在を検索し、 IndexOf メソッドを使用して、検出されたインデックス値を取得します。
// 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