DiscoveryClientReferenceCollection Clase

Definición

Representa una colección de objetos DiscoveryReference. Esta clase no puede heredarse.

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
Herencia
DiscoveryClientReferenceCollection

Ejemplos

#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

Comentarios

La References propiedad de DiscoveryClientProtocol es de tipo DiscoveryClientReferenceCollection.

Constructores

DiscoveryClientReferenceCollection()

Inicializa una nueva instancia de la clase DiscoveryClientReferenceCollection.

Propiedades

Count

Obtiene el número de elementos contenidos en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
Dictionary

Obtiene la lista de elementos incluidos en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
InnerHashtable

Obtiene la lista de elementos incluidos en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
Item[String]

Obtiene o establece un objeto DiscoveryReference desde DiscoveryClientReferenceCollection con la dirección URL especificada.

Keys

Obtiene un objeto ICollection con todas las claves del objeto DiscoveryClientReferenceCollection.

Values

Obtiene un objeto ICollection con todos los valores de DiscoveryClientReferenceCollection.

Métodos

Add(DiscoveryReference)

Agrega un objeto DiscoveryReference a DiscoveryClientReferenceCollection.

Add(String, DiscoveryReference)

Agrega DiscoveryReference con la dirección URL y el valor especificados a DiscoveryClientReferenceCollection.

Clear()

Borra el contenido de la instancia de DictionaryBase.

(Heredado de DictionaryBase)
Contains(String)

Determina si DiscoveryClientReferenceCollection contiene DiscoveryReference con la dirección URL especificada.

CopyTo(Array, Int32)

Copia los elementos de DictionaryBase a una Array unidimensional en el índice especificado.

(Heredado de DictionaryBase)
Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetEnumerator()

Devuelve un IDictionaryEnumerator que itera por la instancia de DictionaryBase.

(Heredado de DictionaryBase)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
OnClear()

Ejecuta procesos personalizados adicionales antes de borrar el contenido de la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnClearComplete()

Realiza procesos personalizados adicionales después de borrar el contenido de la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnGet(Object, Object)

Obtiene el elemento con la clave y valor especificados en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnInsert(Object, Object)

Realiza procesos personalizados adicionales antes de insertar un nuevo elemento en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnInsertComplete(Object, Object)

Realiza procesos personalizados adicionales después de insertar un nuevo elemento en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnRemove(Object, Object)

Realiza procesos personalizados adicionales antes de quitar un elemento de la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnRemoveComplete(Object, Object)

Realiza procesos personalizados adicionales después de quitar un elemento de la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnSet(Object, Object, Object)

Realiza procesos personalizados adicionales antes de establecer un valor en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnSetComplete(Object, Object, Object)

Realiza procesos personalizados adicionales después de establecer un valor en la instancia de DictionaryBase.

(Heredado de DictionaryBase)
OnValidate(Object, Object)

Ejecuta procesos personalizados adicionales al validar el elemento con la clave y valor especificados.

(Heredado de DictionaryBase)
Remove(String)

Quita DiscoveryReference con la dirección URL especificada de DiscoveryClientReferenceCollection.

ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Implementaciones de interfaz explícitas

ICollection.IsSynchronized

Obtiene un valor que indica si el acceso a un objeto DictionaryBase está sincronizado (es seguro para subprocesos).

(Heredado de DictionaryBase)
ICollection.SyncRoot

Obtiene un objeto que se puede utilizar para sincronizar el acceso a un objeto DictionaryBase.

(Heredado de DictionaryBase)
IDictionary.Add(Object, Object)

Agrega un elemento con la clave y el valor especificados a DictionaryBase.

(Heredado de DictionaryBase)
IDictionary.Contains(Object)

Determina si DictionaryBase contiene una clave específica.

(Heredado de DictionaryBase)
IDictionary.IsFixedSize

Obtiene un valor que indica si un objeto DictionaryBase tiene un tamaño fijo.

(Heredado de DictionaryBase)
IDictionary.IsReadOnly

Obtiene un valor que indica si un objeto DictionaryBase es de solo lectura.

(Heredado de DictionaryBase)
IDictionary.Item[Object]

Obtiene o establece el valor asociado a la clave especificada.

(Heredado de DictionaryBase)
IDictionary.Keys

Obtiene un objeto ICollection que contiene las claves del objeto DictionaryBase.

(Heredado de DictionaryBase)
IDictionary.Remove(Object)

Quita el elemento con la clave especificada de DictionaryBase.

(Heredado de DictionaryBase)
IDictionary.Values

Obtiene un objeto ICollection que contiene los valores del objeto DictionaryBase.

(Heredado de DictionaryBase)
IEnumerable.GetEnumerator()

Devuelve un objeto IEnumerator que itera a través del objeto DictionaryBase.

(Heredado de DictionaryBase)

Métodos de extensión

Cast<TResult>(IEnumerable)

Convierte los elementos de IEnumerable en el tipo especificado.

OfType<TResult>(IEnumerable)

Filtra los elementos de IEnumerable en función de un tipo especificado.

AsParallel(IEnumerable)

Habilita la paralelización de una consulta.

AsQueryable(IEnumerable)

Convierte una interfaz IEnumerable en IQueryable.

Se aplica a