CodeTypeReferenceCollection.IndexOf(CodeTypeReference) メソッド

定義

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

public:
 int IndexOf(System::CodeDom::CodeTypeReference ^ value);
public int IndexOf(System.CodeDom.CodeTypeReference value);
member this.IndexOf : System.CodeDom.CodeTypeReference -> int
Public Function IndexOf (value As CodeTypeReference) As Integer

パラメーター

value
CodeTypeReference

コレクション内で検索する CodeTypeReference

返品

コレクション内の指定した CodeTypeReference のインデックス (見つかった場合)。 それ以外の場合は -1。

// 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

適用対象

こちらもご覧ください