ServiceDescriptionCollection 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 uma coleção de instâncias da ServiceDescription classe. Esta 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
| Name | Description |
|---|---|
| ServiceDescriptionCollection() |
Inicializa uma nova instância da ServiceDescriptionCollection classe. |
Propriedades
| Name | Description |
|---|---|
| Capacity |
Obtém ou define o número de elementos que podem CollectionBase conter. (Herdado de CollectionBase) |
| Count |
Obtém o número de elementos contidos na CollectionBase instância. Esta propriedade não pode ser substituída. (Herdado de CollectionBase) |
| InnerList |
Obtém um ArrayList contendo a lista de elementos na CollectionBase instância. (Herdado de CollectionBase) |
| Item[Int32] |
Obtém ou define o valor de a ServiceDescription no índice zero especificado. |
| Item[String] |
Obtém um ServiceDescription especificado pela sua TargetNamespace propriedade. |
| List |
Obtém um IList contendo a lista de elementos na CollectionBase instância. (Herdado de CollectionBase) |
| Table |
Obtém uma interface que implementa a associação das chaves e valores no ServiceDescriptionBaseCollection. (Herdado de ServiceDescriptionBaseCollection) |
Métodos
| Name | Description |
|---|---|
| Add(ServiceDescription) |
Adiciona o especificado ServiceDescription ao final do ServiceDescriptionCollection. |
| Clear() |
Remove todos os objetos da CollectionBase instância. Este método não pode ser ultrapassado. (Herdado de CollectionBase) |
| Contains(ServiceDescription) |
Devolve um valor que indica se o especificado ServiceDescription é membro da coleção. |
| CopyTo(ServiceDescription[], Int32) |
Copia todo ServiceDescriptionCollection para um array unidimensional do tipo ServiceDescription, começando no índice zero especificado do array alvo. |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetBinding(XmlQualifiedName) |
Pesquisa no ServiceDescriptionCollection e retorna o Binding com o nome especificado que é membro de uma das ServiceDescription instâncias contidas na coleção. |
| GetEnumerator() |
Devolve um enumerador que itera pela CollectionBase instância. (Herdado de CollectionBase) |
| GetHashCode() |
Serve como função de hash predefinida. (Herdado de Object) |
| GetKey(Object) |
Devolve o nome da chave associada ao valor passado por referência. (Herdado de ServiceDescriptionBaseCollection) |
| GetMessage(XmlQualifiedName) |
Pesquisa no ServiceDescriptionCollection e retorna o Message com o nome especificado que é membro de uma das ServiceDescription instâncias contidas na coleção. |
| GetPortType(XmlQualifiedName) |
Pesquisa no ServiceDescriptionCollection e retorna o PortType com o nome especificado que é membro de uma das ServiceDescription instâncias contidas na coleção. |
| GetService(XmlQualifiedName) |
Pesquisa no ServiceDescriptionCollection e retorna o Service com o nome especificado que é membro de uma das ServiceDescription instâncias contidas na coleção. |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| IndexOf(ServiceDescription) |
Procura o especificado ServiceDescription e devolve o índice baseado em zero da primeira ocorrência dentro da coleção. |
| Insert(Int32, ServiceDescription) |
Adiciona a instância especificada ServiceDescription ao ServiceDescriptionCollection no índice baseado em zero especificado. |
| MemberwiseClone() |
Cria uma cópia superficial do atual Object. (Herdado de Object) |
| OnClear() |
Limpa o conteúdo da ServiceDescriptionBaseCollection instância. (Herdado de ServiceDescriptionBaseCollection) |
| OnClearComplete() |
Realiza processos personalizados adicionais após limpar o conteúdo da CollectionBase instância. (Herdado de CollectionBase) |
| OnInsert(Int32, Object) |
Realiza processos personalizados adicionais antes de inserir um novo elemento na CollectionBase instância. (Herdado de CollectionBase) |
| OnInsertComplete(Int32, Object) |
Executa 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 CollectionBase instância. (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 definir um valor na CollectionBase instância. (Herdado de CollectionBase) |
| OnValidate(Object) |
Realiza processos personalizados adicionais ao validar um valor. (Herdado de CollectionBase) |
| Remove(ServiceDescription) |
Remove a primeira ocorrência do especificado ServiceDescription da coleção. |
| RemoveAt(Int32) |
Remove o elemento no índice especificado da CollectionBase instância. Este método não é ultrapassível. (Herdado de CollectionBase) |
| SetParent(Object, Object) |
Define o objeto pai da ServiceDescriptionBaseCollection instância. (Herdado de ServiceDescriptionBaseCollection) |
| ToString() |
Devolve uma cadeia que representa o objeto atual. (Herdado de Object) |
Implementações de Interface Explícita
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Copia a totalidade CollectionBase para uma unidimensional Arraycompatível , começando no índice especificado do array alvo. (Herdado de CollectionBase) |
| ICollection.IsSynchronized |
Recebe um valor que indica se o acesso ao 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) |
Procura o especificado Object e devolve o índice baseado em zero da primeira ocorrência dentro de todo CollectionBaseo . (Herdado de CollectionBase) |
| IList.Insert(Int32, Object) |
Insere um elemento no CollectionBase í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 |
Recebe um valor que indica se o CollectionBase é apenas de 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 da Extensão
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Permite a paralelização de uma consulta. |
| AsQueryable(IEnumerable) |
Converte um IEnumerable para um IQueryable. |
| Cast<TResult>(IEnumerable) |
Conjura os elementos de an IEnumerable para o tipo especificado. |
| OfType<TResult>(IEnumerable) |
Filtra os elementos de um IEnumerable com base num tipo especificado. |