This documentation is archived and is not being maintained.

DiscoveryClientReferenceCollection.Item Property

Gets or sets a DiscoveryReference object from the DiscoveryClientReferenceCollection with the specified URL.

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

[Visual Basic]
Public Default Property Item( _
   ByVal url As String _
) As DiscoveryReference
[C#]
public DiscoveryReference this[
 string url
] {get; set;}
[C++]
public: __property DiscoveryReference* get_Item(
 String* url
);
public: __property void set_Item(
 String* url,
   DiscoveryReference*
);
[JScript]
returnValue = DiscoveryClientReferenceCollectionObject.Item(url);
DiscoveryClientReferenceCollectionObject.Item(url) = returnValue;
-or-
returnValue = DiscoveryClientReferenceCollectionObject(url);
DiscoveryClientReferenceCollectionObject(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 for the DiscoveryReference to get or set from the DiscoveryClientReferenceCollection.

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

url
The URL for the DiscoveryReference to get or set from the DiscoveryClientReferenceCollection.

Property Value

An DiscoveryReference representing a reference to a discovery document.

Example

[Visual Basic] 

      Dim myDiscoveryClientReferenceCollection As _
          New DiscoveryClientReferenceCollection()

      Dim myContractReference As New ContractReference()
      Dim myStringUrl1 As String = "http://www.contoso.com/service1.disco"
      myContractReference.Ref = myStringUrl1
      myDiscoveryClientReferenceCollection.Add(myContractReference)
      ' myDiscoveryClientReferenceCollection is an instance collection.
      Dim myObject As Object = _
          myDiscoveryClientReferenceCollection.Item(myStringUrl1)
      Console.WriteLine("Object representing the URL: " + myObject.ToString())

[C#] 
DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection = 
    new DiscoveryClientReferenceCollection();

ContractReference myContractReference = new ContractReference();
string myStringUrl1 = "http://www.contoso.com/service1.disco";
myContractReference.Ref = myStringUrl1;
myDiscoveryClientReferenceCollection.Add(myContractReference);

// myDiscoveryClientReferenceCollection is an instance collection.
object myObject = myDiscoveryClientReferenceCollection[myStringUrl1];
Console.WriteLine("Object representing the URL: " + myObject.ToString());

[C++] 
DiscoveryClientReferenceCollection* myDiscoveryClientReferenceCollection =
   new DiscoveryClientReferenceCollection();

ContractReference* myContractReference = new ContractReference();
String* myStringUrl1 = S"http://www.contoso.com/service1.disco";
myContractReference->Ref = myStringUrl1;
myDiscoveryClientReferenceCollection->Add(myContractReference);

// myDiscoveryClientReferenceCollection is an instance collection.
Object* myObject = myDiscoveryClientReferenceCollection->Item[myStringUrl1];
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

DiscoveryClientReferenceCollection Class | DiscoveryClientReferenceCollection Members | System.Web.Services.Discovery Namespace

Show: