CodeNamespaceCollection.Contains(CodeNamespace) Metoda

Definice

Získá hodnotu, která označuje, zda kolekce obsahuje zadaný CodeNamespace objekt.

public:
 bool Contains(System::CodeDom::CodeNamespace ^ value);
public bool Contains (System.CodeDom.CodeNamespace value);
member this.Contains : System.CodeDom.CodeNamespace -> bool
Public Function Contains (value As CodeNamespace) As Boolean

Parametry

value
CodeNamespace

Vyhledá CodeNamespace se v kolekci.

Návraty

trueCodeNamespace pokud je v kolekci obsažena, jinak falsehodnota .

Příklady

Následující příklad používá metodu Contains k vyhledání objektu CodeNamespace v objektu CodeNamespaceCollection.

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace^ testNamespace = gcnew 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.
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

Platí pro

Viz také