ServiceDescriptionCollection Classe

Definição

Representa uma coleção de instâncias da classe ServiceDescription. Essa classe não pode ser herdada.

public ref class ServiceDescriptionCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class ServiceDescriptionCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type ServiceDescriptionCollection = class
    inherit ServiceDescriptionBaseCollection
Public NotInheritable Class ServiceDescriptionCollection
Inherits ServiceDescriptionBaseCollection
Herança

Exemplos

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

using namespace System;
using namespace System::Xml;
using namespace System::Web::Services::Description;

int main()
{
   try
   {
      // Get ServiceDescription objects.
      ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" );
      ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" );

      // Set the names of the ServiceDescriptions.
      myServiceDescription1->Name = "DataTypes";
      myServiceDescription2->Name = "MathService";

      // Create a ServiceDescriptionCollection.
      ServiceDescriptionCollection^ myServiceDescriptionCollection = gcnew ServiceDescriptionCollection;

      // Add the ServiceDescriptions to the collection.
      myServiceDescriptionCollection->Add( myServiceDescription1 );
      myServiceDescriptionCollection->Add( myServiceDescription2 );

      // Display the elements of the collection using the Item property.
      Console::WriteLine( "Elements in the collection: " );
      for ( int i = 0; i < myServiceDescriptionCollection->Count; i++ )
         Console::WriteLine( myServiceDescriptionCollection[ i ]->Name );

      // Construct an XML qualified name.
      XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" );

      // Get the Binding from the collection.
      Binding^ myBinding = myServiceDescriptionCollection->GetBinding( myXmlQualifiedName );
      Console::WriteLine( "Binding found in collection with name: {0}", myBinding->ServiceDescription->Name );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "The following exception was raised: {0}", e->Message );
   }
}
using System;
using System.Xml;
using System.Web.Services.Description;

class MyServiceDescriptionCollection
{
   public static void Main()
   {
      try
      {
         // Get ServiceDescription objects.
         ServiceDescription myServiceDescription1 =
            ServiceDescription.Read("DataTypes_CS.wsdl");
         ServiceDescription myServiceDescription2 =
            ServiceDescription.Read("MathService_CS.wsdl");

         // Set the names of the ServiceDescriptions.
         myServiceDescription1.Name = "DataTypes";
         myServiceDescription2.Name = "MathService";

         // Create a ServiceDescriptionCollection.
         ServiceDescriptionCollection myServiceDescriptionCollection =
            new ServiceDescriptionCollection();

         // Add the ServiceDescriptions to the collection.
         myServiceDescriptionCollection.Add(myServiceDescription1);
         myServiceDescriptionCollection.Add(myServiceDescription2);

         // Display the elements of the collection using the indexer.
         Console.WriteLine("Elements in the collection: ");
         for(int i = 0; i < myServiceDescriptionCollection.Count; i++)
         {
            Console.WriteLine(myServiceDescriptionCollection[i].Name);
         }

         // Construct an XML qualified name.
         XmlQualifiedName myXmlQualifiedName =
            new XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/");

         // Get the Binding from the collection.
         Binding myBinding =
            myServiceDescriptionCollection.GetBinding(myXmlQualifiedName);

         Console.WriteLine("Binding found in collection with name: " +
                           myBinding.ServiceDescription.Name);
      }
      catch(Exception e)
      {
         Console.WriteLine("The following exception was raised: {0}", e.Message);
      }
   }
}
Imports System.Xml
Imports System.Web.Services.Description

Class MyServiceDescriptionCollection
   
   Public Shared Sub Main()
      Try
         ' Get ServiceDescription objects.
         Dim myServiceDescription1 As ServiceDescription = _
            ServiceDescription.Read("DataTypes_VB.wsdl")
         Dim myServiceDescription2 As ServiceDescription = _
            ServiceDescription.Read("MathService_VB.wsdl")

         ' Set the names of the ServiceDescriptions.
         myServiceDescription1.Name = "DataTypes"
         myServiceDescription2.Name = "MathService"
         
         ' Create a ServiceDescriptionCollection.
         Dim myServiceDescriptionCollection As _
            New ServiceDescriptionCollection()
         
         ' Add the ServiceDescriptions to the collection. 
         myServiceDescriptionCollection.Add(myServiceDescription1)
         myServiceDescriptionCollection.Add(myServiceDescription2)
         
         ' Display the elements of the collection using the Item property.
         Console.WriteLine("Elements in the collection: ")
         Dim i As Integer
         For i = 0 To myServiceDescriptionCollection.Count - 1
            Console.WriteLine(myServiceDescriptionCollection(i).Name)
         Next i

         ' Construct an XML qualified name.
         Dim myXmlQualifiedName As New XmlQualifiedName( _
            "MathServiceSoap", "http://tempuri2.org/")
         
         ' Get the Binding from the collection.
         Dim myBinding As Binding =  _
            myServiceDescriptionCollection.GetBinding(myXmlQualifiedName)
         
         Console.WriteLine("Binding found in collection with name: " &  _
            myBinding.ServiceDescription.Name)
      Catch e As Exception
         Console.WriteLine("The following exception was raised: {0}", _
                 e.Message.ToString())
      End Try
   End Sub
End Class

Construtores

ServiceDescriptionCollection()

Inicializa uma nova instância da classe ServiceDescriptionCollection.

Propriedades

Capacity

Obtém ou define o número de elementos que o CollectionBase pode conter.

(Herdado de CollectionBase)
Count

Obtém o número de elementos contidos na instância de CollectionBase. Essa propriedade não pode ser substituída.

(Herdado de CollectionBase)
InnerList

Obtém uma ArrayList que contém a lista de elementos na instância de CollectionBase.

(Herdado de CollectionBase)
Item[Int32]

Obtém ou define o valor de um ServiceDescription no índice de base zero especificado.

Item[String]

Obtém um ServiceDescription especificado por sua propriedade TargetNamespace.

List

Obtém uma IList que contém a lista de elementos na instância de CollectionBase.

(Herdado de CollectionBase)
Table

Obtém uma interface que implementa a associação das chaves e valores no ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)

Métodos

Add(ServiceDescription)

Adiciona o ServiceDescription especificado ao final do ServiceDescriptionCollection.

Clear()

Remove todos os objetos da instância CollectionBase. Esse método não pode ser substituído.

(Herdado de CollectionBase)
Contains(ServiceDescription)

Retorna um valor que indica se o ServiceDescription especificado é um membro da coleção.

CopyTo(ServiceDescription[], Int32)

Copia todo o ServiceDescriptionCollection para uma matriz unidimensional do tipo ServiceDescription, começando no índice de base zero especificado da matriz de destino.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetBinding(XmlQualifiedName)

Pesquisa a ServiceDescriptionCollection e retorna o Binding com o nome que é um membro de uma das instâncias de ServiceDescription contidas na coleção.

GetEnumerator()

Retorna um enumerador que itera pela instância CollectionBase.

(Herdado de CollectionBase)
GetHashCode()

Serve como a função de hash padrão.

(Herdado de Object)
GetKey(Object)

Retorna o nome da chave associada com o valor passado por referência.

(Herdado de ServiceDescriptionBaseCollection)
GetMessage(XmlQualifiedName)

Pesquisa a ServiceDescriptionCollection e retorna o Message com o nome que é um membro de uma das instâncias de ServiceDescription contidas na coleção.

GetPortType(XmlQualifiedName)

Pesquisa a ServiceDescriptionCollection e retorna o PortType com o nome que é um membro de uma das instâncias de ServiceDescription contidas na coleção.

GetService(XmlQualifiedName)

Pesquisa a ServiceDescriptionCollection e retorna o Service com o nome que é um membro de uma das instâncias de ServiceDescription contidas na coleção.

GetType()

Obtém o Type da instância atual.

(Herdado de Object)
IndexOf(ServiceDescription)

Pesquisa o ServiceDescription especificado e retorna o índice de base zero da primeira ocorrência dentro de toda a coleção.

Insert(Int32, ServiceDescription)

Adiciona a instância de ServiceDescription especificada ao ServiceDescriptionCollection no índice de base zero especificado.

MemberwiseClone()

Cria uma cópia superficial do Object atual.

(Herdado de Object)
OnClear()

Limpa o conteúdo da instância ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)
OnClearComplete()

Executa processos adicionais personalizados após limpar o conteúdo da instância CollectionBase.

(Herdado de CollectionBase)
OnInsert(Int32, Object)

Executa os processos personalizados adicionais antes de inserir um novo elemento na instância CollectionBase.

(Herdado de CollectionBase)
OnInsertComplete(Int32, Object)

Realiza processos personalizados adicionais após inserir um novo elemento no ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)
OnRemove(Int32, Object)

Remove um elemento do ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)
OnRemoveComplete(Int32, Object)

Executa processos personalizados adicionais após remover um elemento da instância de CollectionBase.

(Herdado de CollectionBase)
OnSet(Int32, Object, Object)

Substitui um valor por outro dentro do ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)
OnSetComplete(Int32, Object, Object)

Executa processos personalizados adicionais após configurar um valor na instância de CollectionBase.

(Herdado de CollectionBase)
OnValidate(Object)

Executa processos personalizados adicionais ao validar um valor.

(Herdado de CollectionBase)
Remove(ServiceDescription)

Remove a primeira ocorrência do ServiceDescription especificado da coleção.

RemoveAt(Int32)

Remove o elemento no índice especificado da instância CollectionBase. Este método não é substituível.

(Herdado de CollectionBase)
SetParent(Object, Object)

Define o objeto pai da instância de ServiceDescriptionBaseCollection.

(Herdado de ServiceDescriptionBaseCollection)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)

Implantações explícitas de interface

ICollection.CopyTo(Array, Int32)

Copia todo o CollectionBase em um Array unidimensional compatível, começando no índice especificado da matriz de destino.

(Herdado de CollectionBase)
ICollection.IsSynchronized

Obtém um valor que indica se o acesso à CollectionBase é sincronizado (thread-safe).

(Herdado de CollectionBase)
ICollection.SyncRoot

Obtém um objeto que pode ser usado para sincronizar o acesso ao CollectionBase.

(Herdado de CollectionBase)
IList.Add(Object)

Adiciona um objeto ao final do CollectionBase.

(Herdado de CollectionBase)
IList.Contains(Object)

Determina se o CollectionBase contém um elemento específico.

(Herdado de CollectionBase)
IList.IndexOf(Object)

Pesquisa o Object especificado e retorna o índice de base zero da primeira ocorrência dentro de todo o CollectionBase.

(Herdado de CollectionBase)
IList.Insert(Int32, Object)

Insere um elemento no CollectionBase, no índice especificado.

(Herdado de CollectionBase)
IList.IsFixedSize

Obtém um valor que indica se o CollectionBase tem um tamanho fixo.

(Herdado de CollectionBase)
IList.IsReadOnly

Obtém um valor que indica se o CollectionBase é somente leitura.

(Herdado de CollectionBase)
IList.Item[Int32]

Obtém ou define o elemento no índice especificado.

(Herdado de CollectionBase)
IList.Remove(Object)

Remove a primeira ocorrência de um objeto específico do CollectionBase.

(Herdado de CollectionBase)

Métodos de Extensão

Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.

AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.

AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.

Aplica-se a