DiscoveryClientDocumentCollection Klass

Definition

Representerar en samling dokument som identifierades under IDENTIFIERING av XML-webbtjänster som har laddats ned till klienten. Det går inte att ärva den här klassen.

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

Exempel

I följande kodexempel implementeras XML-webbtjänstidentifiering och de identifierade dokumenten laddas ned till klienten. Namnen på identifieringsdokumenten DiscoveryClientDocumentCollection i är utdata till konsolen.

#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

Kommentarer

Egenskapen Documents för är av DiscoveryClientProtocol typen DiscoveryClientDocumentCollection.

Konstruktorer

Name Description
DiscoveryClientDocumentCollection()

Initierar en ny instans av DiscoveryClientDocumentCollection klassen.

Egenskaper

Name Description
Count

Hämtar antalet element som finns i instansen DictionaryBase .

(Ärvd från DictionaryBase)
Dictionary

Hämtar listan över element som finns i instansen DictionaryBase .

(Ärvd från DictionaryBase)
InnerHashtable

Hämtar listan över element som finns i instansen DictionaryBase .

(Ärvd från DictionaryBase)
Item[String]

Hämtar eller anger ett dokumentobjekt för klientidentifiering från DiscoveryClientDocumentCollection med den angivna URL:en.

Keys

Hämtar ett ICollection objekt med alla nycklar i DiscoveryClientDocumentCollection.

Values

Hämtar ett ICollection objekt med alla värden i DiscoveryClientDocumentCollection.

Metoder

Name Description
Add(String, Object)

Lägger till ett objekt med den angivna URL:en till DiscoveryClientDocumentCollection.

Clear()

Rensar innehållet i instansen DictionaryBase .

(Ärvd från DictionaryBase)
Contains(String)

Avgör om innehåller DiscoveryClientDocumentCollection ett objekt med den angivna URL:en.

CopyTo(Array, Int32)

Kopierar elementen DictionaryBase till en endimensionell Array vid det angivna indexet.

(Ärvd från DictionaryBase)
Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetEnumerator()

Returnerar en IDictionaryEnumerator som itererar genom instansen DictionaryBase .

(Ärvd från DictionaryBase)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
OnClear()

Utför ytterligare anpassade processer innan innehållet i instansen rensas DictionaryBase .

(Ärvd från DictionaryBase)
OnClearComplete()

Utför ytterligare anpassade processer när innehållet i instansen har rensats DictionaryBase .

(Ärvd från DictionaryBase)
OnGet(Object, Object)

Hämtar elementet med den angivna nyckeln och värdet i instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnInsert(Object, Object)

Utför ytterligare anpassade processer innan du infogar ett nytt element i instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnInsertComplete(Object, Object)

Utför ytterligare anpassade processer när du har infogat ett nytt element i instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnRemove(Object, Object)

Utför ytterligare anpassade processer innan du tar bort ett element från instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnRemoveComplete(Object, Object)

Utför ytterligare anpassade processer när du har tagit bort ett element från instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnSet(Object, Object, Object)

Utför ytterligare anpassade processer innan du anger ett värde i instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnSetComplete(Object, Object, Object)

Utför ytterligare anpassade processer när du har angett ett värde i instansen DictionaryBase .

(Ärvd från DictionaryBase)
OnValidate(Object, Object)

Utför ytterligare anpassade processer när elementet verifieras med den angivna nyckeln och värdet.

(Ärvd från DictionaryBase)
Remove(String)

Tar bort ett objekt med den angivna URL:en från DiscoveryClientDocumentCollection.

ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Explicita gränssnittsimplementeringar

Name Description
ICollection.IsSynchronized

Hämtar ett värde som anger om åtkomsten till ett DictionaryBase objekt synkroniseras (trådsäker).

(Ärvd från DictionaryBase)
ICollection.SyncRoot

Hämtar ett objekt som kan användas för att synkronisera åtkomst till ett DictionaryBase objekt.

(Ärvd från DictionaryBase)
IDictionary.Add(Object, Object)

Lägger till ett element med den angivna nyckeln och värdet i DictionaryBase.

(Ärvd från DictionaryBase)
IDictionary.Contains(Object)

Avgör om innehåller DictionaryBase en specifik nyckel.

(Ärvd från DictionaryBase)
IDictionary.IsFixedSize

Hämtar ett värde som anger om ett DictionaryBase objekt har en fast storlek.

(Ärvd från DictionaryBase)
IDictionary.IsReadOnly

Hämtar ett värde som anger om ett DictionaryBase objekt är skrivskyddat.

(Ärvd från DictionaryBase)
IDictionary.Item[Object]

Hämtar eller anger värdet som är associerat med den angivna nyckeln.

(Ärvd från DictionaryBase)
IDictionary.Keys

Hämtar ett ICollection objekt som innehåller nycklarna i objektet DictionaryBase .

(Ärvd från DictionaryBase)
IDictionary.Remove(Object)

Tar bort elementet med den angivna nyckeln från DictionaryBase.

(Ärvd från DictionaryBase)
IDictionary.Values

Hämtar ett ICollection objekt som innehåller värdena i objektet DictionaryBase .

(Ärvd från DictionaryBase)
IEnumerable.GetEnumerator()

Returnerar en IEnumerator som itererar via DictionaryBase.

(Ärvd från DictionaryBase)

Tilläggsmetoder

Name Description
AsParallel(IEnumerable)

Möjliggör parallellisering av en fråga.

AsQueryable(IEnumerable)

Konverterar en IEnumerable till en IQueryable.

Cast<TResult>(IEnumerable)

Omvandlar elementen i en IEnumerable till den angivna typen.

OfType<TResult>(IEnumerable)

Filtrerar elementen i en IEnumerable baserat på en angiven typ.

Gäller för

Se även