This documentation is archived and is not being maintained.

DiscoveryClientDocumentCollection.Contains Method

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

[Visual Basic]
Public Function Contains( _
   ByVal url As String _
) As Boolean
[C#]
public bool Contains(
 string url
);
[C++]
public: bool Contains(
 String* url
);
[JScript]
public function Contains(
   url : String
) : Boolean;

Parameters

url
The URL for the document to locate within the DiscoveryClientDocumentCollection.

Return Value

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

Exceptions

Exception Type Condition
ArgumentNullException url is a null reference (Nothing in Visual Basic).

Example

[Visual Basic, C#, C++] 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.

[Visual Basic] 
Dim myContains As Boolean = myDiscoveryClientDocumentCollection.Contains(myStringUrl)
If myContains Then
   Console.WriteLine("The discovery document {0} is present in the Collection", _
                                                                        myStringUrl)
End If

[C#] 
bool myContains = myDiscoveryClientDocumentCollection.Contains(myStringUrl);
if (myContains)
   Console.WriteLine("The discovery document {0} is present in the" 
                     + " Collection",myStringUrl);

[C++] 
bool myContains = myDiscoveryClientDocumentCollection->Contains(myStringUrl);
if (myContains)
   Console::WriteLine(S"The discovery document {0} is present in the  Collection", myStringUrl);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DiscoveryClientDocumentCollection Class | DiscoveryClientDocumentCollection Members | System.Web.Services.Discovery Namespace | Contains

Show: