CodeStatementCollection.IndexOf(CodeStatement) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
koleksiyonda varsa içinde belirtilen CodeStatement nesnenin CodeStatementCollectiondizinini alır.
public:
int IndexOf(System::CodeDom::CodeStatement ^ value);
public int IndexOf (System.CodeDom.CodeStatement value);
member this.IndexOf : System.CodeDom.CodeStatement -> int
Public Function IndexOf (value As CodeStatement) As Integer
Parametreler
- value
- CodeStatement
CodeStatement koleksiyonunda bulun.
Döndürülenler
Belirtilen nesnenin dizini( bulunursa) koleksiyonda; aksi takdirde, -1.
Örnekler
Aşağıdaki örnek belirli CodeStatement bir varlığı arar ve bulunduğu dizin değerini almak için yöntemini kullanır IndexOf .
// Tests for the presence of a CodeStatement in the
// collection, and retrieves its index if it is found.
int itemIndex = -1;
if ( collection->Contains( testStatement ) )
itemIndex = collection->IndexOf( testStatement );
// Tests for the presence of a CodeStatement in the
// collection, and retrieves its index if it is found.
int itemIndex = -1;
if( collection.Contains( testStatement ) )
itemIndex = collection.IndexOf( testStatement );
' Tests for the presence of a CodeStatement in the
' collection, and retrieves its index if it is found.
Dim itemIndex As Integer = -1
If collection.Contains(testStatement) Then
itemIndex = collection.IndexOf(testStatement)
End If