DiscoveryClientDocumentCollection Klasa

Definicja

Reprezentuje kolekcję dokumentów odnalezionych podczas odnajdywania usług sieci Web XML pobranych do klienta. Klasa ta nie może być dziedziczona.

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
Dziedziczenie
DiscoveryClientDocumentCollection

Przykłady

Poniższy przykład kodu wprowadza odnajdywanie usługi sieci Web XML i pobiera odnalezione dokumenty do klienta. Nazwy dokumentów odnajdywania w obrębie programu DiscoveryClientDocumentCollection są wyprowadzane do konsoli programu .

#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

Uwagi

Właściwość Documents jest DiscoveryClientProtocol typu DiscoveryClientDocumentCollection.

Konstruktory

DiscoveryClientDocumentCollection()

Inicjuje nowe wystąpienie klasy DiscoveryClientDocumentCollection.

Właściwości

Count

Pobiera liczbę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
Dictionary

Pobiera listę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
InnerHashtable

Pobiera listę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
Item[String]

Pobiera lub ustawia obiekt dokumentu odnajdywania klienta z DiscoveryClientDocumentCollection określonego adresu URL.

Keys

ICollection Pobiera obiekt ze wszystkimi kluczami w obiekcie DiscoveryClientDocumentCollection.

Values

ICollection Pobiera obiekt ze wszystkimi wartościami w obiekcie DiscoveryClientDocumentCollection.

Metody

Add(String, Object)

Dodaje obiekt o określonym adresie URL do obiektu DiscoveryClientDocumentCollection.

Clear()

Czyści zawartość DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
Contains(String)

Określa, czy obiekt DiscoveryClientDocumentCollection zawiera określony adres URL.

CopyTo(Array, Int32)

Kopiuje DictionaryBase elementy do jednowymiarowego Array w określonym indeksie.

(Odziedziczone po DictionaryBase)
Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetEnumerator()

Zwraca iterowanie IDictionaryEnumeratorDictionaryBase przez wystąpienie.

(Odziedziczone po DictionaryBase)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
OnClear()

Wykonuje dodatkowe procesy niestandardowe przed wyczyszczeniem zawartości DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnClearComplete()

Wykonuje dodatkowe procesy niestandardowe po wyczyszczeniu zawartości DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnGet(Object, Object)

Pobiera element z określonym kluczem i wartością w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnInsert(Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed wstawieniem nowego elementu do DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnInsertComplete(Object, Object)

Wykonuje dodatkowe procesy niestandardowe po wstawieniu nowego elementu do DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnRemove(Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed usunięciem elementu z DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnRemoveComplete(Object, Object)

Wykonuje dodatkowe procesy niestandardowe po usunięciu DictionaryBase elementu z wystąpienia.

(Odziedziczone po DictionaryBase)
OnSet(Object, Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed ustawieniem wartości w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnSetComplete(Object, Object, Object)

Wykonuje dodatkowe procesy niestandardowe po ustawieniu wartości w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnValidate(Object, Object)

Wykonuje dodatkowe procesy niestandardowe podczas sprawdzania poprawności elementu przy użyciu określonego klucza i wartości.

(Odziedziczone po DictionaryBase)
Remove(String)

Usuwa obiekt z określonym adresem URL z obiektu DiscoveryClientDocumentCollection.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

ICollection.IsSynchronized

Pobiera wartość wskazującą, czy dostęp do DictionaryBase obiektu jest synchronizowany (bezpieczny wątek).

(Odziedziczone po DictionaryBase)
ICollection.SyncRoot

Pobiera obiekt, który może służyć do synchronizowania dostępu do DictionaryBase obiektu.

(Odziedziczone po DictionaryBase)
IDictionary.Add(Object, Object)

Dodaje element z określonym kluczem i wartością do elementu DictionaryBase.

(Odziedziczone po DictionaryBase)
IDictionary.Contains(Object)

Określa, czy element DictionaryBase zawiera określony klucz.

(Odziedziczone po DictionaryBase)
IDictionary.IsFixedSize

Pobiera wartość wskazującą, czy DictionaryBase obiekt ma stały rozmiar.

(Odziedziczone po DictionaryBase)
IDictionary.IsReadOnly

Pobiera wartość wskazującą DictionaryBase , czy obiekt jest tylko do odczytu.

(Odziedziczone po DictionaryBase)
IDictionary.Item[Object]

Pobiera lub ustawia wartość skojarzona z określonym kluczem.

(Odziedziczone po DictionaryBase)
IDictionary.Keys

ICollection Pobiera obiekt zawierający klucze w DictionaryBase obiekcie.

(Odziedziczone po DictionaryBase)
IDictionary.Remove(Object)

Usuwa element z określonym kluczem z elementu DictionaryBase.

(Odziedziczone po DictionaryBase)
IDictionary.Values

ICollection Pobiera obiekt zawierający wartości w DictionaryBase obiekcie.

(Odziedziczone po DictionaryBase)
IEnumerable.GetEnumerator()

IEnumerator Zwraca iterowanie DictionaryBaseprzez element .

(Odziedziczone po DictionaryBase)

Metody rozszerzania

Cast<TResult>(IEnumerable)

Rzutuje elementy elementu IEnumerable na określony typ.

OfType<TResult>(IEnumerable)

Filtruje elementy elementu IEnumerable na podstawie określonego typu.

AsParallel(IEnumerable)

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)

Konwertuje element IEnumerable na .IQueryable

Dotyczy

Zobacz też