Muokkaa

Jaa


DiscoveryClientDocumentCollection.Contains(String) Method

Definition

Determines if the DiscoveryClientDocumentCollection contains an object with the specified URL.

public:
 bool Contains(System::String ^ url);
public bool Contains (string url);
member this.Contains : string -> bool
Public Function Contains (url As String) As Boolean

Parameters

url
String

The URL for the document to locate within the DiscoveryClientDocumentCollection.

Returns

true if the DiscoveryClientDocumentCollection contains an object with the specified URL; otherwise, false.

Exceptions

url is null.

Examples

The following code example calls the Contains method to determine if the discovery document contains a member with the URL stored in the StringUrl variable.

bool myContains = myDiscoveryClientDocumentCollection->Contains( myStringUrl );
if ( myContains )
   Console::WriteLine( "The discovery document {0} is present in the  Collection", myStringUrl );
bool myContains = myDiscoveryClientDocumentCollection.Contains(myStringUrl);
if (myContains)
   Console.WriteLine("The discovery document {0} is present in the"
                     + " Collection",myStringUrl);
Dim myContains As Boolean = myDiscoveryClientDocumentCollection.Contains(myStringUrl)
If myContains Then
   Console.WriteLine("The discovery document {0} is present in the Collection", _
                                                                        myStringUrl)
End If

Applies to

See also