次の方法で共有


CodeParameterDeclarationExpressionCollection.IndexOf メソッド

指定した CodeParameterDeclarationExpression がコレクション内に存在する場合は、コレクション内でのそのインデックスを取得します。

Public Function IndexOf( _
   ByVal value As CodeParameterDeclarationExpression _) As Integer
[C#]
public int IndexOf(CodeParameterDeclarationExpressionvalue);
[C++]
public: int IndexOf(CodeParameterDeclarationExpression* value);
[JScript]
public function IndexOf(
   value : CodeParameterDeclarationExpression) : int;

パラメータ

戻り値

見つかった場合はコレクション内での指定したオブジェクトのインデックス。それ以外の場合は -1。

使用例

 
' 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

[C#] 
// 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 );

[C++] 
// Tests for the presence of a CodeParameterDeclarationExpression 
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression* testParameter = new CodeParameterDeclarationExpression(__typeof(int), S"testIntArgument");
int itemIndex = -1;
if( collection->Contains( testParameter ) )
    itemIndex = collection->IndexOf( testParameter );

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

CodeParameterDeclarationExpressionCollection クラス | CodeParameterDeclarationExpressionCollection メンバ | System.CodeDom 名前空間 | Contains