DiscoveryClientReferenceCollection Klass

Definition

Representerar en samling DiscoveryReference objekt. Det går inte att ärva den här klassen.

public ref class DiscoveryClientReferenceCollection sealed : System::Collections::DictionaryBase
public sealed class DiscoveryClientReferenceCollection : System.Collections.DictionaryBase
type DiscoveryClientReferenceCollection = class
    inherit DictionaryBase
Public NotInheritable Class DiscoveryClientReferenceCollection
Inherits DictionaryBase
Arv
DiscoveryClientReferenceCollection

Exempel

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

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

int main()
{
   DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
   myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;
   
   // 'dataservice.vsdisco' is a sample discovery document.
   String^ myStringUrl = "http://localhost/dataservice.vsdisco";
   
   // Call the Discover method to populate the References property.
   DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol->Discover( myStringUrl );
   
   // Resolve all references found in the discovery document.
   myDiscoveryClientProtocol->ResolveAll();
   DiscoveryClientReferenceCollection^ myDiscoveryClientReferenceCollection = myDiscoveryClientProtocol->References;
   
   // Retrieve the keys from the collection.
   ICollection^ myCollection = myDiscoveryClientReferenceCollection->Keys;
   array<Object^>^myObjectCollection = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection->CopyTo( myObjectCollection, 0 );
   Console::WriteLine( "The discovery documents, service descriptions, and XML schema" );
   Console::WriteLine( " definitions in the collection are: " );
   for ( int i = 0; i < myObjectCollection->Length; i++ )
   {
      Console::WriteLine( myObjectCollection[ i ] );
   }
   Console::WriteLine( "" );
   
   // Retrieve the values from the collection.
   ICollection^ myCollection1 = myDiscoveryClientReferenceCollection->Values;
   array<Object^>^myObjectCollection1 = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection1->CopyTo( myObjectCollection1, 0 );
   Console::WriteLine( "The objects in the collection are: " );
   for ( int i = 0; i < myObjectCollection1->Length; i++ )
   {
      Console::WriteLine( myObjectCollection1[ i ] );
   }
   Console::WriteLine( "" );
   String^ myStringUrl1 = "http://localhost/dataservice.vsdisco";
   if ( myDiscoveryClientReferenceCollection->Contains( myStringUrl1 ) )
   {
      Console::WriteLine( "The document reference {0} is part of the collection.", myStringUrl1 );
   }
}
using System;
using System.Net;
using System.Collections;
using System.Security.Permissions;
using System.Web.Services.Discovery;

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

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

      myDiscoveryClientProtocol.Credentials =
          CredentialCache.DefaultCredentials;

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

      // Call the Discover method to populate the References property.
      DiscoveryDocument myDiscoveryDocument =
          myDiscoveryClientProtocol.Discover(myStringUrl);

      // Resolve all references found in the discovery document.
      myDiscoveryClientProtocol.ResolveAll();

      DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
          myDiscoveryClientProtocol.References;

      // Retrieve the keys from the collection.
      ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
      object[] myObjectCollection =
          new object[myDiscoveryClientReferenceCollection.Count];
      myCollection.CopyTo(myObjectCollection, 0);

      Console.WriteLine("The discovery documents, service descriptions, " +
            "and XML schema");
      Console.WriteLine(" definitions in the collection are: ");
      for (int i=0; i< myObjectCollection.Length; i++)
      {
         Console.WriteLine(myObjectCollection[i]);
      }
      Console.WriteLine("");

      // Retrieve the values from the collection.
      ICollection myCollection1 = myDiscoveryClientReferenceCollection.Values;
      object[] myObjectCollection1 =
          new object[myDiscoveryClientReferenceCollection.Count];
      myCollection1.CopyTo(myObjectCollection1, 0);

      Console.WriteLine("The objects in the collection are: ");
      for (int i=0; i< myObjectCollection1.Length; i++)
      {
         Console.WriteLine(myObjectCollection1[i]);
      }

      Console.WriteLine("");

      string myStringUrl1 = "http://localhost/dataservice.vsdisco";
      if (myDiscoveryClientReferenceCollection.Contains(myStringUrl1))
      {
         Console.WriteLine("The document reference {0} is part of the collection.",
             myStringUrl1);
      }
   }
}
Imports System.Net
Imports System.Collections
Imports System.Security.Permissions
Imports System.Web.Services.Discovery

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

   <PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
   Shared Sub Run()
      Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
      
      myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
      
      ' 'dataservice.vsdisco' is a sample discovery document.
      Dim myStringUrl As String = "http://localhost/dataservice.vsdisco"
      
      ' Call the Discover method to populate the References property.
      Dim myDiscoveryDocument As DiscoveryDocument = _
          myDiscoveryClientProtocol.Discover(myStringUrl)
      
      ' Resolve all references found in the discovery document.
      myDiscoveryClientProtocol.ResolveAll()
      
      Dim myDiscoveryClientReferenceCollection As DiscoveryClientReferenceCollection = _ 
          myDiscoveryClientProtocol.References

      ' Retrieve the keys from the collection.
      Dim myCollection As ICollection = myDiscoveryClientReferenceCollection.Keys
      Dim myObjectCollection(myDiscoveryClientReferenceCollection.Count) As Object
      myCollection.CopyTo(myObjectCollection, 0)

      Console.WriteLine("The discovery documents, service descriptions, and XML schema")
      Console.WriteLine(" definitions in the collection are:")
      Dim i As Integer
      For i = 0 To myObjectCollection.Length - 1
          Console.WriteLine(myObjectCollection(i))
      Next i

      ' Retrieve the values from the collection.
      Dim myCollection1 As ICollection = myDiscoveryClientReferenceCollection.Values
      Dim myObjectCollection1(myDiscoveryClientReferenceCollection.Count - 1) As Object
      myCollection1.CopyTo(myObjectCollection1, 0)
      
      Console.WriteLine("The objects in the collection are:")
      For i = 0 To myObjectCollection1.Length - 1
          Console.WriteLine(myObjectCollection1(i))
      Next i
      
      
      Dim myStringUrl1 As String = "http://localhost/dataservice.vsdisco"
      If myDiscoveryClientReferenceCollection.Contains(myStringUrl1) Then
          Console.WriteLine("The document reference {0} is part of the collection.", _
              myStringUrl1)
      End If
   End Sub

End Class

Kommentarer

Egenskapen References för är av DiscoveryClientProtocol typen DiscoveryClientReferenceCollection.

Konstruktorer

Name Description
DiscoveryClientReferenceCollection()

Initierar en ny instans av DiscoveryClientReferenceCollection 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 DiscoveryReference objekt från DiscoveryClientReferenceCollection med den angivna URL:en.

Keys

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

Values

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

Metoder

Name Description
Add(DiscoveryReference)

Lägger till en DiscoveryReference i DiscoveryClientReferenceCollection.

Add(String, DiscoveryReference)

Lägger till en DiscoveryReference med den angivna URL:en och värdet i DiscoveryClientReferenceCollection.

Clear()

Rensar innehållet i instansen DictionaryBase .

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

Avgör om DiscoveryClientReferenceCollection innehåller en DiscoveryReference 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 en DiscoveryReference med den angivna URL:en från DiscoveryClientReferenceCollection.

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