DiscoveryClientReferenceCollection Klasa

Definicja

Reprezentuje kolekcję DiscoveryReference obiektów. Klasa ta nie może być dziedziczona.

public ref class DiscoveryClientReferenceCollection sealed : System::Collections::DictionaryBase
public sealed class DiscoveryClientReferenceCollection : System.Collections.DictionaryBase
type DiscoveryClientReferenceCollection = class
    inherit DictionaryBase
Public NotInheritable Class DiscoveryClientReferenceCollection
Inherits DictionaryBase
Dziedziczenie
DiscoveryClientReferenceCollection

Przykłady

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

using namespace System;
using namespace System::Net;
using namespace System::Collections;
using namespace System::Web::Services::Discovery;

int main()
{
   DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
   myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;
   
   // 'dataservice.vsdisco' is a sample discovery document.
   String^ myStringUrl = "http://localhost/dataservice.vsdisco";
   
   // Call the Discover method to populate the References property.
   DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol->Discover( myStringUrl );
   
   // Resolve all references found in the discovery document.
   myDiscoveryClientProtocol->ResolveAll();
   DiscoveryClientReferenceCollection^ myDiscoveryClientReferenceCollection = myDiscoveryClientProtocol->References;
   
   // Retrieve the keys from the collection.
   ICollection^ myCollection = myDiscoveryClientReferenceCollection->Keys;
   array<Object^>^myObjectCollection = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection->CopyTo( myObjectCollection, 0 );
   Console::WriteLine( "The discovery documents, service descriptions, and XML schema" );
   Console::WriteLine( " definitions in the collection are: " );
   for ( int i = 0; i < myObjectCollection->Length; i++ )
   {
      Console::WriteLine( myObjectCollection[ i ] );
   }
   Console::WriteLine( "" );
   
   // Retrieve the values from the collection.
   ICollection^ myCollection1 = myDiscoveryClientReferenceCollection->Values;
   array<Object^>^myObjectCollection1 = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection1->CopyTo( myObjectCollection1, 0 );
   Console::WriteLine( "The objects in the collection are: " );
   for ( int i = 0; i < myObjectCollection1->Length; i++ )
   {
      Console::WriteLine( myObjectCollection1[ i ] );
   }
   Console::WriteLine( "" );
   String^ myStringUrl1 = "http://localhost/dataservice.vsdisco";
   if ( myDiscoveryClientReferenceCollection->Contains( myStringUrl1 ) )
   {
      Console::WriteLine( "The document reference {0} is part of the collection.", myStringUrl1 );
   }
}
using System;
using System.Net;
using System.Collections;
using System.Security.Permissions;
using System.Web.Services.Discovery;

class MyDiscoveryClientReferenceCollection
{
   static void Main()
   {
      Run();
   }

   [PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")]
   static void Run()
   {
      DiscoveryClientProtocol myDiscoveryClientProtocol =
          new DiscoveryClientProtocol();

      myDiscoveryClientProtocol.Credentials =
          CredentialCache.DefaultCredentials;

      // 'dataservice.vsdisco' is a sample discovery document.
      string myStringUrl = "http://localhost/dataservice.vsdisco";

      // Call the Discover method to populate the References property.
      DiscoveryDocument myDiscoveryDocument =
          myDiscoveryClientProtocol.Discover(myStringUrl);

      // Resolve all references found in the discovery document.
      myDiscoveryClientProtocol.ResolveAll();

      DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
          myDiscoveryClientProtocol.References;

      // Retrieve the keys from the collection.
      ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
      object[] myObjectCollection =
          new object[myDiscoveryClientReferenceCollection.Count];
      myCollection.CopyTo(myObjectCollection, 0);

      Console.WriteLine("The discovery documents, service descriptions, " +
            "and XML schema");
      Console.WriteLine(" definitions in the collection are: ");
      for (int i=0; i< myObjectCollection.Length; i++)
      {
         Console.WriteLine(myObjectCollection[i]);
      }
      Console.WriteLine("");

      // Retrieve the values from the collection.
      ICollection myCollection1 = myDiscoveryClientReferenceCollection.Values;
      object[] myObjectCollection1 =
          new object[myDiscoveryClientReferenceCollection.Count];
      myCollection1.CopyTo(myObjectCollection1, 0);

      Console.WriteLine("The objects in the collection are: ");
      for (int i=0; i< myObjectCollection1.Length; i++)
      {
         Console.WriteLine(myObjectCollection1[i]);
      }

      Console.WriteLine("");

      string myStringUrl1 = "http://localhost/dataservice.vsdisco";
      if (myDiscoveryClientReferenceCollection.Contains(myStringUrl1))
      {
         Console.WriteLine("The document reference {0} is part of the collection.",
             myStringUrl1);
      }
   }
}
Imports System.Net
Imports System.Collections
Imports System.Security.Permissions
Imports System.Web.Services.Discovery

Class MyDiscoveryClientReferenceCollection
   
   Shared Sub Main()
      Run()
   End Sub

   <PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
   Shared Sub Run()
      Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
      
      myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
      
      ' 'dataservice.vsdisco' is a sample discovery document.
      Dim myStringUrl As String = "http://localhost/dataservice.vsdisco"
      
      ' Call the Discover method to populate the References property.
      Dim myDiscoveryDocument As DiscoveryDocument = _
          myDiscoveryClientProtocol.Discover(myStringUrl)
      
      ' Resolve all references found in the discovery document.
      myDiscoveryClientProtocol.ResolveAll()
      
      Dim myDiscoveryClientReferenceCollection As DiscoveryClientReferenceCollection = _ 
          myDiscoveryClientProtocol.References

      ' Retrieve the keys from the collection.
      Dim myCollection As ICollection = myDiscoveryClientReferenceCollection.Keys
      Dim myObjectCollection(myDiscoveryClientReferenceCollection.Count) As Object
      myCollection.CopyTo(myObjectCollection, 0)

      Console.WriteLine("The discovery documents, service descriptions, and XML schema")
      Console.WriteLine(" definitions in the collection are:")
      Dim i As Integer
      For i = 0 To myObjectCollection.Length - 1
          Console.WriteLine(myObjectCollection(i))
      Next i

      ' Retrieve the values from the collection.
      Dim myCollection1 As ICollection = myDiscoveryClientReferenceCollection.Values
      Dim myObjectCollection1(myDiscoveryClientReferenceCollection.Count - 1) As Object
      myCollection1.CopyTo(myObjectCollection1, 0)
      
      Console.WriteLine("The objects in the collection are:")
      For i = 0 To myObjectCollection1.Length - 1
          Console.WriteLine(myObjectCollection1(i))
      Next i
      
      
      Dim myStringUrl1 As String = "http://localhost/dataservice.vsdisco"
      If myDiscoveryClientReferenceCollection.Contains(myStringUrl1) Then
          Console.WriteLine("The document reference {0} is part of the collection.", _
              myStringUrl1)
      End If
   End Sub

End Class

Uwagi

Właściwość References jest DiscoveryClientProtocol typu DiscoveryClientReferenceCollection.

Konstruktory

DiscoveryClientReferenceCollection()

Inicjuje nowe wystąpienie klasy DiscoveryClientReferenceCollection.

Właściwości

Count

Pobiera liczbę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
Dictionary

Pobiera listę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
InnerHashtable

Pobiera listę elementów zawartych w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
Item[String]

Pobiera lub ustawia DiscoveryReference obiekt z DiscoveryClientReferenceCollection określonego adresu URL.

Keys

ICollection Pobiera obiekt ze wszystkimi kluczami w obiekcie DiscoveryClientReferenceCollection.

Values

ICollection Pobiera obiekt ze wszystkimi wartościami w obiekcie DiscoveryClientReferenceCollection.

Metody

Add(DiscoveryReference)

Dodaje element do DiscoveryReference elementu DiscoveryClientReferenceCollection.

Add(String, DiscoveryReference)

Dodaje element DiscoveryReference z określonym adresem URL i wartością do elementu DiscoveryClientReferenceCollection.

Clear()

Czyści zawartość DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
Contains(String)

Określa, czy element DiscoveryClientReferenceCollection zawiera element DiscoveryReference z określonym adresem URL.

CopyTo(Array, Int32)

Kopiuje DictionaryBase elementy do jednowymiarowego Array w określonym indeksie.

(Odziedziczone po DictionaryBase)
Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetEnumerator()

Zwraca obiekt, który IDictionaryEnumerator iteruje po wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
OnClear()

Wykonuje dodatkowe procesy niestandardowe przed wyczyszczeniem zawartości DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnClearComplete()

Wykonuje dodatkowe procesy niestandardowe po wyczyszczeniu zawartości DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnGet(Object, Object)

Pobiera element z określonym kluczem i wartością w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnInsert(Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed wstawieniem nowego elementu do DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnInsertComplete(Object, Object)

Wykonuje dodatkowe procesy niestandardowe po wstawieniu nowego elementu do DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnRemove(Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed usunięciem elementu z DictionaryBase wystąpienia.

(Odziedziczone po DictionaryBase)
OnRemoveComplete(Object, Object)

Wykonuje dodatkowe procesy niestandardowe po usunięciu DictionaryBase elementu z wystąpienia.

(Odziedziczone po DictionaryBase)
OnSet(Object, Object, Object)

Wykonuje dodatkowe procesy niestandardowe przed ustawieniem wartości w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnSetComplete(Object, Object, Object)

Wykonuje dodatkowe procesy niestandardowe po ustawieniu wartości w wystąpieniu DictionaryBase .

(Odziedziczone po DictionaryBase)
OnValidate(Object, Object)

Wykonuje dodatkowe procesy niestandardowe podczas sprawdzania poprawności elementu przy użyciu określonego klucza i wartości.

(Odziedziczone po DictionaryBase)
Remove(String)

Usuwa element DiscoveryReference o określonym adresie URL z obiektu DiscoveryClientReferenceCollection.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

ICollection.IsSynchronized

Pobiera wartość wskazującą DictionaryBase , czy dostęp do obiektu jest synchronizowany (bezpieczny wątek).

(Odziedziczone po DictionaryBase)
ICollection.SyncRoot

Pobiera obiekt, który może służyć do synchronizowania dostępu do DictionaryBase obiektu.

(Odziedziczone po DictionaryBase)
IDictionary.Add(Object, Object)

Dodaje element z określonym kluczem i wartością do elementu DictionaryBase.

(Odziedziczone po DictionaryBase)
IDictionary.Contains(Object)

Określa, czy element DictionaryBase zawiera określony klucz.

(Odziedziczone po DictionaryBase)
IDictionary.IsFixedSize

Pobiera wartość wskazującą, czy DictionaryBase obiekt ma stały rozmiar.

(Odziedziczone po DictionaryBase)
IDictionary.IsReadOnly

Pobiera wartość wskazującą DictionaryBase , czy obiekt jest tylko do odczytu.

(Odziedziczone po DictionaryBase)
IDictionary.Item[Object]

Pobiera lub ustawia wartość skojarzona z określonym kluczem.

(Odziedziczone po DictionaryBase)
IDictionary.Keys

ICollection Pobiera obiekt zawierający klucze w DictionaryBase obiekcie.

(Odziedziczone po DictionaryBase)
IDictionary.Remove(Object)

Usuwa element z określonym kluczem z elementu DictionaryBase.

(Odziedziczone po DictionaryBase)
IDictionary.Values

ICollection Pobiera obiekt zawierający wartości w DictionaryBase obiekcie.

(Odziedziczone po DictionaryBase)
IEnumerable.GetEnumerator()

IEnumerator Zwraca iterowanie DictionaryBaseprzez element .

(Odziedziczone po DictionaryBase)

Metody rozszerzania

Cast<TResult>(IEnumerable)

Rzutuje elementy elementu IEnumerable na określony typ.

OfType<TResult>(IEnumerable)

Filtruje elementy IEnumerable elementu na podstawie określonego typu.

AsParallel(IEnumerable)

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)

Konwertuje element IEnumerable na .IQueryable

Dotyczy