DiscoveryClientReferenceCollection Třída

Definice

Představuje kolekci DiscoveryReference objektů.Represents a collection of DiscoveryReference objects. Tuto třídu nelze zdědit.This class cannot be inherited.

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
Dědičnost
DiscoveryClientReferenceCollection

Příklady

#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

Poznámky

ReferencesVlastnost DiscoveryClientProtocol je typu DiscoveryClientReferenceCollection .The References property of DiscoveryClientProtocol is of type DiscoveryClientReferenceCollection.

Konstruktory

DiscoveryClientReferenceCollection()

Inicializuje novou instanci DiscoveryClientReferenceCollection třídy.Initializes a new instance of the DiscoveryClientReferenceCollection class.

Vlastnosti

Count

Získá počet prvků obsažených v DictionaryBase instanci.Gets the number of elements contained in the DictionaryBase instance.

(Zděděno od DictionaryBase)
Dictionary

Získá seznam elementů obsažených v DictionaryBase instanci.Gets the list of elements contained in the DictionaryBase instance.

(Zděděno od DictionaryBase)
InnerHashtable

Získá seznam elementů obsažených v DictionaryBase instanci.Gets the list of elements contained in the DictionaryBase instance.

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

Získá nebo nastaví DiscoveryReference objekt ze DiscoveryClientReferenceCollection zadané adresy URL.Gets or sets a DiscoveryReference object from the DiscoveryClientReferenceCollection with the specified URL.

Keys

Získá ICollection objekt se všemi klíči v DiscoveryClientReferenceCollection .Gets an ICollection object with all the keys in the DiscoveryClientReferenceCollection.

Values

Získá ICollection objekt se všemi hodnotami v DiscoveryClientReferenceCollection .Gets an ICollection object with all the values in the DiscoveryClientReferenceCollection.

Metody

Add(DiscoveryReference)

Přidá DiscoveryReference do DiscoveryClientReferenceCollection .Adds a DiscoveryReference to the DiscoveryClientReferenceCollection.

Add(String, DiscoveryReference)

Přidá se DiscoveryReference se zadanou adresou URL a hodnotou do DiscoveryClientReferenceCollection .Adds a DiscoveryReference with the specified URL and value to the DiscoveryClientReferenceCollection.

Clear()

Vymaže obsah DictionaryBase instance.Clears the contents of the DictionaryBase instance.

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

Určuje, zda DiscoveryClientReferenceCollection obsahuje a DiscoveryReference se zadanou adresou URL.Determines if the DiscoveryClientReferenceCollection contains a DiscoveryReference with the specified URL.

CopyTo(Array, Int32)

Zkopíruje DictionaryBase prvky na jednorozměrné Array v zadaném indexu.Copies the DictionaryBase elements to a one-dimensional Array at the specified index.

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

Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object.

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

Vrátí objekt IDictionaryEnumerator , který prochází DictionaryBase instancí.Returns an IDictionaryEnumerator that iterates through the DictionaryBase instance.

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

Slouží jako výchozí funkce hash.Serves as the default hash function.

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

Získá Type aktuální instanci.Gets the Type of the current instance.

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

Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object.

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

Před vymazáním obsahu instance provede další vlastní procesy DictionaryBase .Performs additional custom processes before clearing the contents of the DictionaryBase instance.

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

Provede další vlastní procesy po vymazání obsahu DictionaryBase instance.Performs additional custom processes after clearing the contents of the DictionaryBase instance.

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

Získá prvek se zadaným klíčem a hodnotou v DictionaryBase instanci.Gets the element with the specified key and value in the DictionaryBase instance.

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

Provede další vlastní procesy před vložením nového elementu do DictionaryBase instance.Performs additional custom processes before inserting a new element into the DictionaryBase instance.

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

Provede další vlastní procesy po vložení nového elementu do DictionaryBase instance.Performs additional custom processes after inserting a new element into the DictionaryBase instance.

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

Provede další vlastní procesy před odebráním elementu z DictionaryBase instance.Performs additional custom processes before removing an element from the DictionaryBase instance.

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

Provede další vlastní procesy po odebrání elementu z DictionaryBase instance.Performs additional custom processes after removing an element from the DictionaryBase instance.

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

Před nastavením hodnoty v instanci provádí další vlastní procesy DictionaryBase .Performs additional custom processes before setting a value in the DictionaryBase instance.

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

Provede další vlastní procesy po nastavení hodnoty v DictionaryBase instanci.Performs additional custom processes after setting a value in the DictionaryBase instance.

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

Provádí další vlastní procesy při ověřování elementu pomocí zadaného klíče a hodnoty.Performs additional custom processes when validating the element with the specified key and value.

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

Odstraní DiscoveryReference se zadanou adresou URL z DiscoveryClientReferenceCollection .Removes a DiscoveryReference with the specified URL from the DiscoveryClientReferenceCollection.

ToString()

Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object.

(Zděděno od Object)

Explicitní implementace rozhraní

ICollection.IsSynchronized

Načte hodnotu, která označuje, jestli je přístup k DictionaryBase objektu synchronizovaný (bezpečná pro vlákno).Gets a value indicating whether access to a DictionaryBase object is synchronized (thread safe).

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

Získává objekt, který lze použít k synchronizaci přístupu k DictionaryBase objektu.Gets an object that can be used to synchronize access to a DictionaryBase object.

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

Přidá prvek se zadaným klíčem a hodnotou do DictionaryBase .Adds an element with the specified key and value into the DictionaryBase.

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

Určuje, zda DictionaryBase obsahuje konkrétní klíč.Determines whether the DictionaryBase contains a specific key.

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

Získá hodnotu, která označuje, zda DictionaryBase má objekt pevnou velikost.Gets a value indicating whether a DictionaryBase object has a fixed size.

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

Získá hodnotu, která označuje, zda DictionaryBase je objekt určen jen pro čtení.Gets a value indicating whether a DictionaryBase object is read-only.

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

Získá nebo nastaví hodnotu přidruženou k zadanému klíči.Gets or sets the value associated with the specified key.

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

Získá ICollection objekt obsahující klíče v DictionaryBase objektu.Gets an ICollection object containing the keys in the DictionaryBase object.

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

Odebere prvek se zadaným klíčem z DictionaryBase .Removes the element with the specified key from the DictionaryBase.

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

Získá ICollection objekt obsahující hodnoty v DictionaryBase objektu.Gets an ICollection object containing the values in the DictionaryBase object.

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

Vrátí objekt IEnumerator , který projde DictionaryBase .Returns an IEnumerator that iterates through the DictionaryBase.

(Zděděno od DictionaryBase)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypování prvky IEnumerable na zadaný typ.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filtruje prvky IEnumerable založené na zadaném typu.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Povoluje paralelní zpracování dotazu.Enables parallelization of a query.

AsQueryable(IEnumerable)

Převede IEnumerable na IQueryable .Converts an IEnumerable to an IQueryable.

Platí pro