CodeNamespaceCollection.IndexOf(CodeNamespace) 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 CodeNamespacevarsa içinde belirtilen CodeNamespaceCollection nesnenin dizinini alır.
public:
int IndexOf(System::CodeDom::CodeNamespace ^ value);
public int IndexOf(System.CodeDom.CodeNamespace value);
member this.IndexOf : System.CodeDom.CodeNamespace -> int
Public Function IndexOf (value As CodeNamespace) As Integer
Parametreler
- value
- CodeNamespace
CodeNamespace bulunacak.
Döndürülenler
Belirtilen CodeNamespacedizininde bulunursa, koleksiyonda bulunur; aksi takdirde -1.
Örnekler
Aşağıdaki örnek belirli CodeNamespace bir varlığı arar ve bulunduğu dizin değerini almak için yöntemini kullanır IndexOf .
// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
int itemIndex = -1;
if( collection.Contains( testNamespace ) )
itemIndex = collection.IndexOf( testNamespace );
' Tests for the presence of a CodeNamespace in the collection,
' and retrieves its index if it is found.
Dim testNamespace As New CodeNamespace("TestNamespace")
Dim itemIndex As Integer = -1
If collection.Contains(testNamespace) Then
itemIndex = collection.IndexOf(testNamespace)
End If