DiscoveryClientResult Classe
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Representa os detalhes de uma referência de descoberta sem o conteúdo do documento referenciado. Esta classe não pode ser herdada.
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
Observações
Usando o WriteAll método de DiscoveryClientProtocol, todos os documentos referenciados válidos e um ficheiro contendo um mapa de todos os documentos gravados podem ser escritos no disco. O ficheiro contendo um mapa de todos os documentos guardados contém os detalhes de cada documento resumidos pelas propriedades de DiscoveryClientResult.
Depois de os documentos referenciados e o mapa dos documentos referenciados terem sido escritos no disco usando o WriteAll método, pode invocar o ReadAll método para ler os documentos de descoberta.
Construtores
| Name | Description |
|---|---|
| DiscoveryClientResult() |
Inicializa uma nova instância da DiscoveryClientResult classe. |
| DiscoveryClientResult(Type, String, String) |
Inicializa uma nova instância da DiscoveryClientResult classe e define a ReferenceTypeName propriedade para |
Propriedades
| Name | Description |
|---|---|
| Filename |
Obtém ou define o nome do ficheiro onde a referência está guardada. |
| ReferenceTypeName |
Nome da classe que representa o tipo de referência no documento de descoberta. |
| Url |
Obtém ou define o URL da referência. |
Métodos
| Name | Description |
|---|---|
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetHashCode() |
Serve como função de hash predefinida. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do atual Object. (Herdado de Object) |
| ToString() |
Devolve uma cadeia que representa o objeto atual. (Herdado de Object) |