This documentation is archived and is not being maintained.

DiscoveryClientDocumentCollection.Keys Property

Gets an System.Collections.ICollection object with all the keys in the DiscoveryClientDocumentCollection.

[Visual Basic]
Public ReadOnly Property Keys As ICollection
[C#]
public ICollection Keys {get;}
[C++]
public: __property ICollection* get_Keys();
[JScript]
public function get Keys() : ICollection;

Property Value

An ICollection containing the keys of the DiscoveryClientDocumentCollection.

Example

[Visual Basic, C#, C++] The following code example outputs the keys within the DiscoveryClientDocumentCollection to the console.

[Visual Basic] 
Dim myCollection As ICollection = myDiscoveryClientDocumentCollection.Keys
Dim myObjectCollection(myDiscoveryClientDocumentCollection.Count-1) As Object
myCollection.CopyTo(myObjectCollection, 0)
Console.WriteLine("The discovery documents in the collection are :")
Dim iIndex As Integer
For iIndex = 0 To myObjectCollection.Length - 1
   Console.WriteLine(myObjectCollection(iIndex))
Next iIndex

[C#] 
ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
object[] myObjectCollection = 
               new object[myDiscoveryClientDocumentCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents in the collection are :");
for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)
{
   Console.WriteLine(myObjectCollection[iIndex]);
}

[C++] 
ICollection* myCollection = myDiscoveryClientDocumentCollection->Keys;
Object* myObjectCollection[] = new Object*[myDiscoveryClientDocumentCollection->Count];
myCollection->CopyTo(myObjectCollection, 0);
Console::WriteLine(S"The discovery documents in the collection are :");
for (int iIndex=0; iIndex < myObjectCollection->Length; iIndex++)
   Console::WriteLine(myObjectCollection->Item[iIndex]);

[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 | Keys

Show: