DiscoveryReferenceCollection Classe

Definição

Uma coleção de referências de descoberta. Essa classe não pode ser herdada.

public ref class DiscoveryReferenceCollection sealed : System::Collections::CollectionBase
public sealed class DiscoveryReferenceCollection : System.Collections.CollectionBase
type DiscoveryReferenceCollection = class
    inherit CollectionBase
Public NotInheritable Class DiscoveryReferenceCollection
Inherits CollectionBase
Herança
DiscoveryReferenceCollection

Exemplos

#using <System.Web.Services.dll>

using namespace System;
using namespace System::IO;
using namespace System::Web::Services::Discovery;

int main()
{
   DiscoveryDocumentReference^ myDiscoveryDocReference1 = gcnew DiscoveryDocumentReference;
   DiscoveryDocumentReference^ myDiscoveryDocReference2 = gcnew DiscoveryDocumentReference;
   DiscoveryReference^ myDiscoveryReference;
   Console::WriteLine( "Demonstrating DiscoveryReferenceCollection class." );
   
   // Create new DiscoveryReferenceCollection.
   DiscoveryReferenceCollection^ myDiscoveryReferenceCollection = gcnew DiscoveryReferenceCollection;
   
   // Access the Count method.
   Console::WriteLine( "The number of elements in the collection is: {0}", myDiscoveryReferenceCollection->Count );
   
   // Add elements to the collection.
   myDiscoveryReferenceCollection->Add( myDiscoveryDocReference1 );
   myDiscoveryReferenceCollection->Add( myDiscoveryDocReference2 );
   Console::WriteLine( "The number of elements in the collection after adding two elements to the collection: {0}", myDiscoveryReferenceCollection->Count );
   
   // Call the Contains method.
   if ( myDiscoveryReferenceCollection->Contains( myDiscoveryDocReference1 ) != true )
   {
      throw gcnew Exception( "Element not found in collection." );
   }
   
   // Access the indexed member.
   myDiscoveryReference = dynamic_cast<DiscoveryReference^>(myDiscoveryReferenceCollection[ 0 ]);
   if ( myDiscoveryReference == nullptr )
   {
      throw gcnew Exception( "Element not found in collection." );
   }
   
   // Remove one element from collection.
   myDiscoveryReferenceCollection->Remove( myDiscoveryDocReference1 );
   Console::WriteLine( "The number of elements in the collection after removing one element is: {0}", myDiscoveryReferenceCollection->Count );
}
using System;
using System.IO;
using System.Web.Services.Discovery;

class MyDiscoveryDocumentClass
{
   static void Main()
   {
      DiscoveryDocumentReference myDiscoveryDocReference1 =
         new DiscoveryDocumentReference();
      DiscoveryDocumentReference myDiscoveryDocReference2 =
         new DiscoveryDocumentReference();
      DiscoveryReference myDiscoveryReference;

      Console.WriteLine("Demonstrating DiscoveryReferenceCollection class.");

      // Create new DiscoveryReferenceCollection.
      DiscoveryReferenceCollection myDiscoveryReferenceCollection =
         new DiscoveryReferenceCollection();

      // Access the Count method.
      Console.WriteLine("The number of elements in the collection is: "
         + myDiscoveryReferenceCollection.Count.ToString());

      // Add elements to the collection.
      myDiscoveryReferenceCollection.Add(myDiscoveryDocReference1);
      myDiscoveryReferenceCollection.Add(myDiscoveryDocReference2);

      Console.WriteLine("The number of elements in the collection "
         + "after adding two elements to the collection: "
         + myDiscoveryReferenceCollection.Count.ToString());

      // Call the Contains method.
      if (myDiscoveryReferenceCollection.Contains(myDiscoveryDocReference1)
         != true)
      {
         throw new Exception("Element not found in collection.");
      }

      // Access the indexed member.
      myDiscoveryReference =
         (DiscoveryReference)myDiscoveryReferenceCollection[0];
      if (myDiscoveryReference == null)
      {
         throw new Exception("Element not found in collection.");
      }

      // Remove one element from collection.
      myDiscoveryReferenceCollection.Remove(myDiscoveryDocReference1);
      Console.WriteLine("The number of elements in the collection "
         + "after removing one element is: "
         + myDiscoveryReferenceCollection.Count.ToString());
   }
}
Imports System.IO
Imports System.Web.Services.Discovery

Class MyDiscoveryDocumentMod

   Shared Sub Main()
   Try
      Dim myDiscoveryDocReference1 As New DiscoveryDocumentReference()
      Dim myDiscoveryDocReference2 As New DiscoveryDocumentReference()
      Dim myDiscoveryReference As DiscoveryReference

      Console.WriteLine("Demonstrating DiscoveryReferenceCollection class.")

      ' Create new DiscoveryReferenceCollection.
      Dim myDiscoveryReferenceCollection As New DiscoveryReferenceCollection()

      ' Access the Count method.
      Console.WriteLine("The number of elements in collection is: " & _
         myDiscoveryReferenceCollection.Count.ToString())

      ' Add elements to the collection.
      myDiscoveryReferenceCollection.Add(myDiscoveryDocReference1)
      myDiscoveryReferenceCollection.Add(myDiscoveryDocReference2)

      Console.WriteLine("The number of elements in the collection " _
         & "after adding two elements to the collection: " _
         & myDiscoveryReferenceCollection.Count.ToString())

      ' Call the Contains method.
      If myDiscoveryReferenceCollection.Contains(myDiscoveryDocReference1) _
         <> True Then
         Throw New Exception("Element not found in collection.")
      End If

      ' Access the Item property.
      myDiscoveryReference = myDiscoveryReferenceCollection.Item(0)

      If  myDiscoveryReference Is Nothing Then
         Throw New Exception("Element not found in collection.")
      End If

      ' Remove one element from the collection.
      myDiscoveryReferenceCollection.Remove(myDiscoveryDocReference1)
      Console.WriteLine("The number of elements in collection " _
         & "after removing one element is: " _
         & myDiscoveryReferenceCollection.Count.ToString())

   Catch e As Exception
       Console.Writeline("Exception occurred : " + e.Message)
   End Try
   End Sub

End Class

Construtores

DiscoveryReferenceCollection()

Inicializa uma nova instância da classe DiscoveryReferenceCollection.

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 DiscoveryReference no índice especificado.

List

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

(Herdado de CollectionBase)

Métodos

Add(DiscoveryReference)

Adiciona um DiscoveryReference ao DiscoveryReferenceCollection.

Clear()

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

(Herdado de CollectionBase)
Contains(DiscoveryReference)

Determina se o DiscoveryReferenceCollection contém um DiscoveryReference específico.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
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)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.

(Herdado de Object)
OnClear()

Executa processos personalizados adicionais ao limpar o conteúdo da instância CollectionBase.

(Herdado de CollectionBase)
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)

Executa processos personalizados adicionais após inserir um novo elemento na instância de CollectionBase.

(Herdado de CollectionBase)
OnRemove(Int32, Object)

Executa processos personalizados adicionais ao remover um elemento da instância CollectionBase.

(Herdado de CollectionBase)
OnRemoveComplete(Int32, Object)

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

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

Executa processos personalizados adicionais antes de definir um valor na instância CollectionBase.

(Herdado de CollectionBase)
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(DiscoveryReference)

Remove um DiscoveryReference do DiscoveryReferenceCollection.

RemoveAt(Int32)

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

(Herdado de CollectionBase)
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