DiscoveryClientResult Classe

Definição

Representa os detalhes de uma referência de descoberta sem o conteúdo do documento referenciado.Represents the details of a discovery reference without the contents of the referenced document. Essa classe não pode ser herdada.This class cannot be inherited.

public ref class DiscoveryClientResult sealed
public sealed class DiscoveryClientResult
type DiscoveryClientResult = class
Public NotInheritable Class DiscoveryClientResult
Herança
DiscoveryClientResult

Exemplos

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

using namespace System;
using namespace System::Web::Services::Discovery;
int main()
{
   try
   {
      DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
      
      // Get the collection holding DiscoveryClientResult objects.
      DiscoveryClientResultCollection^ myDiscoveryClientResultCollection = myDiscoveryClientProtocol->ReadAll( "results.discomap" );
      Console::WriteLine( "The number of DiscoveryClientResult objects: {0}", myDiscoveryClientResultCollection->Count );
      Console::WriteLine( "Displaying the items in the collection:" );
      
      // Iterate through the collection and display the properties
      // of each DiscoveryClientResult in it.
      System::Collections::IEnumerator^ myEnum = myDiscoveryClientResultCollection->GetEnumerator();
      while ( myEnum->MoveNext() )
      {
         DiscoveryClientResult^ myDiscoveryClientResult = safe_cast<DiscoveryClientResult^>(myEnum->Current);
         Console::WriteLine( "Type of reference in the discovery document: {0}", myDiscoveryClientResult->ReferenceTypeName );
         Console::WriteLine( "Url for the reference: {0}", myDiscoveryClientResult->Url );
         Console::WriteLine( "File for saving the reference: {0}", myDiscoveryClientResult->Filename );
      }
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Error is {0}", e->Message );
   }

}

using System;
using System.Web.Services.Discovery;
public class MyDiscoveryClientResult
{
    static void Main()
    {
        try
        {
            DiscoveryClientProtocol myDiscoveryClientProtocol =
                new DiscoveryClientProtocol();

            // Get the collection holding DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection =
                myDiscoveryClientProtocol.ReadAll("results.discomap");
            Console.WriteLine("The number of DiscoveryClientResult objects: "
                + myDiscoveryClientResultCollection.Count);
            Console.WriteLine("Displaying the items in the collection:");

            // Iterate through the collection and display the properties
            // of each DiscoveryClientResult in it.
            foreach(DiscoveryClientResult myDiscoveryClientResult in
                myDiscoveryClientResultCollection)
            {
                Console.WriteLine(
                    "Type of reference in the discovery document: "
                    + myDiscoveryClientResult.ReferenceTypeName);
                Console.WriteLine("Url for the reference: "
                    + myDiscoveryClientResult.Url);
                Console.WriteLine("File for saving the reference: "
                    + myDiscoveryClientResult.Filename);
            }
        }
        catch(Exception e)
        {
            Console.WriteLine("Error is " + e.Message);
        }
    }
}
Imports System.Web.Services.Discovery

Public Class MyDiscoveryClientResult

    Shared Sub Main()
        Try
            Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()

            ' Get the collection holding DiscoveryClientResult objects.
            Dim myDiscoveryClientResultCollection As _
                DiscoveryClientResultCollection = _
                myDiscoveryClientProtocol.ReadAll("results.discomap")
            Console.WriteLine("The number of DiscoveryClientResult objects: " _
                & myDiscoveryClientResultCollection.Count.ToString())
            Console.WriteLine("Displaying the items in the collection:")

            ' Iterate through the collection and display the properties
            ' of each DiscoveryClientResult in it.
            Dim myDiscoveryClientResult As DiscoveryClientResult
            For Each myDiscoveryClientResult In myDiscoveryClientResultCollection
                Console.WriteLine( _
                    "Type of reference in the discovery document: " _
                    & myDiscoveryClientResult.ReferenceTypeName)
                Console.WriteLine("Url for the reference: " _
                    & myDiscoveryClientResult.Url)
                Console.WriteLine("File for saving the reference: " _
                    & myDiscoveryClientResult.Filename)
            Next myDiscoveryClientResult
        Catch e As Exception
            Console.WriteLine("Error is " + e.Message)
        End Try
    End Sub
End Class

Comentários

Usando o WriteAll método de DiscoveryClientProtocol , todos os documentos referenciados válidos e um arquivo contendo um mapa de todos os documentos salvos podem ser gravados no disco.Using the WriteAll method of DiscoveryClientProtocol, all valid referenced documents and a file containing a map of all save documents can be written to disk. O arquivo que contém um mapa de todos os documentos salvos contém os detalhes de cada documento, conforme resumido pelas propriedades de DiscoveryClientResult .The file containing a map of all saved documents contains the details of each document as summarized by the properties of DiscoveryClientResult.

Depois que os documentos referenciados e o mapa dos documentos referenciados tiverem sido gravados no disco usando o WriteAll método, você poderá invocar o ReadAll método para ler os documentos de descoberta.After the referenced documents and the map of the referenced documents have been written to disk using the WriteAll method, you can invoke the ReadAll method to read the discovery documents.

Construtores

DiscoveryClientResult()

Inicializa uma nova instância da classe DiscoveryClientResult.Initializes a new instance of the DiscoveryClientResult class.

DiscoveryClientResult(Type, String, String)

Inicializa uma nova instância da classe DiscoveryClientResult e define a propriedade ReferenceTypeName para referenceType, a propriedade Url para url e a propriedade Filename para filename.Initializes a new instance of the DiscoveryClientResult class and sets the ReferenceTypeName property to referenceType, the Url property to url and the Filename property to filename.

Propriedades

Filename

Obtém ou define o nome do arquivo em que a referência está salva.Gets or sets the name of the file in which the reference is saved.

ReferenceTypeName

Nome da classe que representa o tipo de referência no documento de descoberta.Name of the class representing the type of reference in the discovery document.

Url

Obtém ou define a URL para a referência.Gets or sets the URL for the reference.

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Aplica-se a