DiscoveryClientResultCollection.Item Property
Gets or sets the DiscoveryClientResult at position i of the DiscoveryClientResultCollection.
[C#] In C#, this property is the indexer for the DiscoveryClientResultCollection class.
[Visual Basic] Public Default Property Item( _ ByVal i As Integer _ ) As DiscoveryClientResult [C#] public DiscoveryClientResult this[ int i ] {get; set;} [C++] public: __property DiscoveryClientResult* get_Item( int i ); public: __property void set_Item( int i, DiscoveryClientResult* ); [JScript] returnValue = DiscoveryClientResultCollectionObject.Item(i); DiscoveryClientResultCollectionObject.Item(i) = returnValue; -or- returnValue = DiscoveryClientResultCollectionObject(i); DiscoveryClientResultCollectionObject(i) = 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]
- i
- The zero-based index of the DiscoveryClientResult to get or set.
Parameters [Visual Basic, C#, C++]
- i
- The zero-based index of the DiscoveryClientResult to get or set.
Property Value
The DiscoveryClientResult at the specified index.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentOutOfRangeException | i is not a valid index in the DiscoveryClientResultCollection. |
Remarks
This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[index].
Example
[Visual Basic] Dim i As Integer For i = 0 To myDiscoveryClientResultCollection.Count - 1 Dim myClientResult As DiscoveryClientResult = _ myDiscoveryClientResultCollection(i) Console.WriteLine("DiscoveryClientResult " & (i + 1).ToString()) Console.WriteLine("Type of reference in the discovery document: " _ & myClientResult.ReferenceTypeName) Console.WriteLine("Url for reference:" & myClientResult.Url) Console.WriteLine("File for saving the reference: " _ & myClientResult.Filename) Next i [C#] for(int i=0; i<myDiscoveryClientResultCollection.Count; i++) { DiscoveryClientResult myClientResult = myDiscoveryClientResultCollection[i]; Console.WriteLine("DiscoveryClientResult "+(i+1)); Console.WriteLine("Type of reference in the discovery document: " + myClientResult.ReferenceTypeName); Console.WriteLine("Url for reference:" + myClientResult.Url); Console.WriteLine("File for saving the reference: " + myClientResult.Filename); } [C++] for(int i=0; i<myDiscoveryClientResultCollection->Count; i++) { DiscoveryClientResult* myClientResult = myDiscoveryClientResultCollection->Item[i]; Console::WriteLine(S"DiscoveryClientResult {0}", __box((i+1))); Console::WriteLine(S"Type of reference in the discovery document: {0}", myClientResult->ReferenceTypeName); Console::WriteLine(S"Url for reference:{0}", myClientResult->Url); Console::WriteLine(S"File for saving the reference: {0}", myClientResult->Filename); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
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
DiscoveryClientResultCollection Class | DiscoveryClientResultCollection Members | System.Web.Services.Discovery Namespace