DiscoveryClientDocumentCollection Třída

Definice

Představuje kolekci dokumentů zjištěných při zjišťování webových služeb XML, které byly staženy do klienta. Tuto třídu nelze zdědit.

public ref class DiscoveryClientDocumentCollection sealed : System::Collections::DictionaryBase
public sealed class DiscoveryClientDocumentCollection : System.Collections.DictionaryBase
type DiscoveryClientDocumentCollection = class
    inherit DictionaryBase
Public NotInheritable Class DiscoveryClientDocumentCollection
Inherits DictionaryBase
Dědičnost
DiscoveryClientDocumentCollection

Příklady

Následující příklad kódu zpracuje zjišťování webových služeb XML a stáhne zjištěné dokumenty do klienta. Názvy dokumentů zjišťování v rámci DiscoveryClientDocumentCollection konzoly jsou výstupem.

#using <System.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Net;
using namespace System::IO;
using namespace System::Collections;
using namespace System::Web::Services::Discovery;

int main()
{
   DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
   myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;
   
   // 'dataservice.disco' is a sample discovery document.
   String^ myStringUrl = "http://localhost/dataservice.disco";
   
   // 'Discover' method is called to populate the 'Documents' property.
   DiscoveryDocument^ myDiscoveryDocument =
      myDiscoveryClientProtocol->Discover( myStringUrl );
   
   // An instance of the 'DiscoveryClientDocumentCollection' class is created.
   DiscoveryClientDocumentCollection^ myDiscoveryClientDocumentCollection =
      myDiscoveryClientProtocol->Documents;
   
   // 'Keys' in the collection are retrieved.
   ICollection^ myCollection = myDiscoveryClientDocumentCollection->Keys;
   array<Object^>^myObjectCollection =
      gcnew array<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 ] );

   }
   Console::WriteLine( "" );
   
   // 'Values' in the collection are retrieved.
   ICollection^ myCollection1 = myDiscoveryClientDocumentCollection->Values;
   array<Object^>^myObjectCollection1 =
      gcnew array<Object^>(myDiscoveryClientDocumentCollection->Count);
   myCollection1->CopyTo( myObjectCollection1, 0 );
   Console::WriteLine( "The objects in the collection are :" );
   for ( int iIndex = 0; iIndex < myObjectCollection1->Length; iIndex++ )
   {
      Console::WriteLine( myObjectCollection1[ iIndex ] );

   }
}
using System;
using System.Net;
using System.IO;
using System.Collections;
using System.Security.Permissions;
using System.Web.Services.Discovery;

class DiscoveryClientDocumentCollectionSample
{
   static void Main()
   {
      Run();
   }

   [PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")]
   static void Run()
   {
      DiscoveryClientProtocol myDiscoveryClientProtocol =
         new DiscoveryClientProtocol();

      myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials;

      // 'dataservice.disco' is a sample discovery document.
      string myStringUrl = "http://localhost/dataservice.disco";

      // 'Discover' method is called to populate the 'Documents' property.
      DiscoveryDocument myDiscoveryDocument =
         myDiscoveryClientProtocol.Discover(myStringUrl);

      // An instance of the 'DiscoveryClientDocumentCollection' class is created.
      DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
         myDiscoveryClientProtocol.Documents;

      // 'Keys' in the collection are retrieved.
      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]);
      }

      Console.WriteLine("");

      // 'Values' in the collection are retrieved.
      ICollection myCollection1 = myDiscoveryClientDocumentCollection.Values;
      object[] myObjectCollection1 =
         new object[myDiscoveryClientDocumentCollection.Count];
      myCollection1.CopyTo(myObjectCollection1, 0);

      Console.WriteLine("The objects in the collection are :");
      for (int iIndex=0; iIndex < myObjectCollection1.Length; iIndex++)
      {
         Console.WriteLine(myObjectCollection1[iIndex]);
      }
   }
}
Imports System.Net
Imports System.IO
Imports System.Collections
Imports System.Security.Permissions
Imports System.Web.Services.Discovery

Class DiscoveryClientDocumentCollectionSample
   
   Shared Sub Main()
      Run()
   End Sub

   <PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
   Shared Sub Run()

      Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
      
      myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
      
      ' 'dataservice.disco' is a sample discovery document.
      Dim myStringUrl As String = "http://localhost/dataservice.disco"
      
      ' 'Discover' method is called to populate the 'Documents' property.
      Dim myDiscoveryDocument As DiscoveryDocument = myDiscoveryClientProtocol.Discover(myStringUrl)
      
      ' An instance of the 'DiscoveryClientDocumentCollection' class is created.
      Dim myDiscoveryClientDocumentCollection As DiscoveryClientDocumentCollection = _
                                                myDiscoveryClientProtocol.Documents
      
      ' 'Keys' in the collection are retrieved.
      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
      
      Console.WriteLine("")
      
      ' 'Values' in the collection are retrieved.
      Dim myCollection1 As ICollection = myDiscoveryClientDocumentCollection.Values
      Dim myObjectCollection1(myDiscoveryClientDocumentCollection.Count-1) As Object
      myCollection1.CopyTo(myObjectCollection1, 0)
      
      Console.WriteLine("The objects in the collection are :")
      For iIndex = 0 To myObjectCollection1.Length - 1
         Console.WriteLine(myObjectCollection1(iIndex))
      Next iIndex
   End Sub
End Class

Poznámky

Vlastnost Documents DiscoveryClientProtocol je typu DiscoveryClientDocumentCollection.

Konstruktory

DiscoveryClientDocumentCollection()

Inicializuje novou instanci DiscoveryClientDocumentCollection třídy.

Vlastnosti

Count

Získá počet prvků obsažených v DictionaryBase instanci.

(Zděděno od DictionaryBase)
Dictionary

Získá seznam prvků obsažených v DictionaryBase instanci.

(Zděděno od DictionaryBase)
InnerHashtable

Získá seznam prvků obsažených v DictionaryBase instanci.

(Zděděno od DictionaryBase)
Item[String]

Získá nebo nastaví objekt dokumentu zjišťování klienta z DiscoveryClientDocumentCollection zadané adresy URL.

Keys

ICollection Získá objekt se všemi klíči v souboru DiscoveryClientDocumentCollection.

Values

ICollection Získá objekt se všemi hodnotami v objektu DiscoveryClientDocumentCollection.

Metody

Add(String, Object)

Přidá objekt se zadanou adresou URL do objektu DiscoveryClientDocumentCollection.

Clear()

Vymaže obsah DictionaryBase instance.

(Zděděno od DictionaryBase)
Contains(String)

Určuje, zda DiscoveryClientDocumentCollection obsahuje objekt se zadanou adresou URL.

CopyTo(Array, Int32)

DictionaryBase Zkopíruje prvky do jednorozměrného Array v zadaném indexu.

(Zděděno od DictionaryBase)
Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

(Zděděno od Object)
GetEnumerator()

IDictionaryEnumerator Vrátí iterátor prostřednictvím DictionaryBase instance.

(Zděděno od DictionaryBase)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Type Získá aktuální instanci.

(Zděděno od Object)
MemberwiseClone()

Vytvoří použádnou kopii aktuálního souboru Object.

(Zděděno od Object)
OnClear()

Před vymazáním obsahu DictionaryBase instance provede další vlastní procesy.

(Zděděno od DictionaryBase)
OnClearComplete()

Provede další vlastní procesy po vymazání obsahu DictionaryBase instance.

(Zděděno od DictionaryBase)
OnGet(Object, Object)

Získá prvek se zadaným klíčem a hodnotou v DictionaryBase instanci.

(Zděděno od DictionaryBase)
OnInsert(Object, Object)

Před vložením nového prvku do DictionaryBase instance provede další vlastní procesy.

(Zděděno od DictionaryBase)
OnInsertComplete(Object, Object)

Provede další vlastní procesy po vložení nového prvku do DictionaryBase instance.

(Zděděno od DictionaryBase)
OnRemove(Object, Object)

Před odebráním elementu DictionaryBase z instance provede další vlastní procesy.

(Zděděno od DictionaryBase)
OnRemoveComplete(Object, Object)

Provede další vlastní procesy po odebrání elementu DictionaryBase z instance.

(Zděděno od DictionaryBase)
OnSet(Object, Object, Object)

Provede další vlastní procesy před nastavením hodnoty v DictionaryBase instanci.

(Zděděno od DictionaryBase)
OnSetComplete(Object, Object, Object)

Provede další vlastní procesy po nastavení hodnoty v DictionaryBase instanci.

(Zděděno od DictionaryBase)
OnValidate(Object, Object)

Provádí další vlastní procesy při ověřování elementu se zadaným klíčem a hodnotou.

(Zděděno od DictionaryBase)
Remove(String)

Odebere objekt se zadanou adresou URL z objektu DiscoveryClientDocumentCollection.

ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

ICollection.IsSynchronized

Získá hodnotu označující, zda je přístup k objektu DictionaryBase synchronizován (bezpečné vlákno).

(Zděděno od DictionaryBase)
ICollection.SyncRoot

Získá objekt, který lze použít k synchronizaci přístupu k objektu DictionaryBase .

(Zděděno od DictionaryBase)
IDictionary.Add(Object, Object)

Přidá prvek se zadaným klíčem a hodnotou do objektu DictionaryBase.

(Zděděno od DictionaryBase)
IDictionary.Contains(Object)

Určuje, zda DictionaryBase obsahuje konkrétní klíč.

(Zděděno od DictionaryBase)
IDictionary.IsFixedSize

Získá hodnotu určující, zda DictionaryBase má objekt pevnou velikost.

(Zděděno od DictionaryBase)
IDictionary.IsReadOnly

Získá hodnotu označující, zda DictionaryBase je objekt jen pro čtení.

(Zděděno od DictionaryBase)
IDictionary.Item[Object]

Získá nebo nastaví hodnotu přidruženou k zadanému klíči.

(Zděděno od DictionaryBase)
IDictionary.Keys

ICollection Získá objekt obsahující klíče v objektuDictionaryBase.

(Zděděno od DictionaryBase)
IDictionary.Remove(Object)

Odebere prvek se zadaným klíčem z objektu DictionaryBase.

(Zděděno od DictionaryBase)
IDictionary.Values

ICollection Získá objekt obsahující hodnoty v objektuDictionaryBase.

(Zděděno od DictionaryBase)
IEnumerable.GetEnumerator()

IEnumerator Vrátí iteruje přes DictionaryBase.

(Zděděno od DictionaryBase)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypuje prvky zadaného IEnumerable typu.

OfType<TResult>(IEnumerable)

Filtruje prvky IEnumerable založené na zadaném typu.

AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede na IEnumerable IQueryable.

Platí pro

Viz také