CodeNamespaceCollection.Contains(CodeNamespace) Methode

Definitie

Hiermee wordt een waarde opgehaald die aangeeft of de verzameling het opgegeven CodeNamespace object bevat.

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

Parameters

value
CodeNamespace

De CodeNamespace te zoeken in de verzameling.

Retouren

trueals de CodeNamespace in de verzameling is opgenomen; anders. false

Voorbeelden

In het volgende voorbeeld wordt de Contains methode gebruikt om een CodeNamespace object in een CodeNamespaceCollection.

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

Van toepassing op

Zie ook