This documentation is archived and is not being maintained.

DiscoveryClientDocumentCollection.Item Property

Gets or sets a client discovery document object from the DiscoveryClientDocumentCollection with the specified URL.

[C#] In C#, this property is the indexer for the DiscoveryClientDocumentCollection class.

[Visual Basic]
Public Default Property Item( _
   ByVal url As String _
) As Object
[C#]
public object this[
 string url
] {get; set;}
[C++]
public: __property Object* get_Item(
 String* url
);
public: __property void set_Item(
 String* url,
   Object*
);
[JScript]
returnValue = DiscoveryClientDocumentCollectionObject.Item(url);
DiscoveryClientDocumentCollectionObject.Item(url) = returnValue;
-or-
returnValue = DiscoveryClientDocumentCollectionObject(url);
DiscoveryClientDocumentCollectionObject(url) = returnValue;

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Arguments [JScript]

url
The URL of the discovery document to get or set from the DiscoveryClientDocumentCollection.

Parameters [Visual Basic, C#, C++]

url
The URL of the discovery document to get or set from the DiscoveryClientDocumentCollection.

Property Value

An Object representing the document discovered and downloaded to the client. The underlying type of the object can be a ServiceDescription, XmlSchema, or DiscoveryDocument.

Exceptions

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

Example

[Visual Basic, C#, C++] The following code example outputs to the console the type of the discovery document in the DiscoveryClientDocumentCollection that has a URL matching the value of the myStringUrl variable.

[Visual Basic] 
Dim myObject As Object = myDiscoveryClientDocumentCollection(myStringUrl)
Console.WriteLine(("Object representing the Url : " + myObject.ToString()))

[C#] 
object myObject = myDiscoveryClientDocumentCollection[myStringUrl];
Console.WriteLine("Object representing the Url : " + myObject.ToString());

[C++] 
Object* myObject = myDiscoveryClientDocumentCollection->Item[myStringUrl];
Console::WriteLine(S"Object representing the Url : {0}", myObject);

[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

Show: