Библиотека классов платформы .NET Framework
DiscoveryClientResultCollection - класс

Обновлен: Ноябрь 2007

Содержит коллекцию объектов DiscoveryClientResult. Этот класс не наследуется.

Пространство имен:  System.Web.Services.Discovery
Сборка:  System.Web.Services (в System.Web.Services.dll)
Синтаксис

Язык Visual Basic (Объявление)
Public NotInheritable Class DiscoveryClientResultCollection _
    Inherits CollectionBase
Язык Visual Basic (Использование)
Dim instance As DiscoveryClientResultCollection
Язык C#
public sealed class DiscoveryClientResultCollection : CollectionBase
Язык Visual C++
public ref class DiscoveryClientResultCollection sealed : public CollectionBase
Язык J#
public final class DiscoveryClientResultCollection extends CollectionBase
Язык JScript
public final class DiscoveryClientResultCollection extends CollectionBase
Примеры

Язык Visual Basic
Imports System
Imports System.Reflection
Imports System.IO
Imports System.Web.Services.Discovery
Imports System.Xml.Schema
Imports System.Collections

Public Class MyDiscoveryClientResult

   Shared Sub Main()
      Try
         Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()

         ' Get the collection of DiscoveryClientResult objects.
         Dim myDiscoveryClientResultCollection As _
             DiscoveryClientResultCollection = _
             myDiscoveryClientProtocol.ReadAll("results.discomap")
         Console.WriteLine( _
             "Removing a DiscoveryClientResult from the collection...")

         ' Remove the first DiscoveryClientResult from the collection.
         myDiscoveryClientResultCollection.Remove( _
             myDiscoveryClientResultCollection(0))
         Console.WriteLine("Adding a DiscoveryClientResult" & _
             " to the collection...")
         Dim myDiscoveryClientResult As New DiscoveryClientResult()

         ' Set the DiscoveryDocumentReference class as the type of 
         ' reference in the discovery document.
         myDiscoveryClientResult.ReferenceTypeName = _
             "System.Web.Services.Discovery.DiscoveryDocumentReference"

         ' Set the URL for the reference.
         myDiscoveryClientResult.Url = _
             "http://localhost/Discovery/Service1_vb.asmx?disco"

         ' Set the name of the file in which the reference is saved.
         myDiscoveryClientResult.Filename = "Service1_vb.disco"

         ' Add myDiscoveryClientResult to the collection.
         myDiscoveryClientResultCollection.Add(myDiscoveryClientResult)

         If myDiscoveryClientResultCollection.Contains( _ 
             myDiscoveryClientResult) Then

             Console.WriteLine( _
                 "Instance of DiscoveryClientResult found in the Collection")
         End If

      Catch ex As Exception
         Console.WriteLine("Error is " + ex.Message)
      End Try
   End Sub 'Main
End Class 'MyDiscoveryClientResult
Язык C#
using System;
using System.Reflection;
using System.IO;
using System.Web.Services.Discovery;
using System.Xml.Schema;
using System.Collections;

public class MyDiscoveryClientResult
{
   static void Main()
   {
      try
      {
         DiscoveryClientProtocol myDiscoveryClientProtocol = 
             new DiscoveryClientProtocol();

         // Get the collection of DiscoveryClientResult objects.
         DiscoveryClientResultCollection myDiscoveryClientResultCollection =
             myDiscoveryClientProtocol.ReadAll("results.discomap");
         Console.WriteLine(
             "Removing a DiscoveryClientResult from the collection...");

         // Remove the first DiscoveryClientResult from the collection.
         myDiscoveryClientResultCollection.Remove(
             myDiscoveryClientResultCollection[0]);
         Console.WriteLine("Adding a DiscoveryClientResult" +
             " to the collection...");
         DiscoveryClientResult myDiscoveryClientResult = 
             new DiscoveryClientResult();

         // Set the DiscoveryDocumentReference class as the type of 
         // reference in the discovery document.
         myDiscoveryClientResult.ReferenceTypeName = 
             "System.Web.Services.Discovery.DiscoveryDocumentReference";

         // Set the URL for the reference.
         myDiscoveryClientResult.Url = 
             "http://localhost/Discovery/Service1_cs.asmx?disco";

         // Set the name of the file in which the reference is saved.
         myDiscoveryClientResult.Filename = "Service1_cs.disco";

         // Add myDiscoveryClientResult to the collection.
         myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
         if(myDiscoveryClientResultCollection.Contains(myDiscoveryClientResult))
         {
            Console.WriteLine(
                "Instance of DiscoveryClientResult found in the Collection");
         }
      }
      catch(Exception ex)
      {
         Console.WriteLine("Error is "+ex.Message);
      }
   }
}
Язык Visual C++
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>

using namespace System;
using namespace System::Reflection;
using namespace System::IO;
using namespace System::Web::Services::Discovery;
using namespace System::Xml::Schema;
using namespace System::Collections;

int main()
{
   try
   {
      DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;

      // Get the collection of DiscoveryClientResult objects.
      DiscoveryClientResultCollection^ myDiscoveryClientResultCollection =
         myDiscoveryClientProtocol->ReadAll( "results.discomap" );
      Console::WriteLine( "Removing a DiscoveryClientResult from the collection..." );

      // Remove the first DiscoveryClientResult from the collection.
      myDiscoveryClientResultCollection->Remove( myDiscoveryClientResultCollection[ 0 ] );
      Console::WriteLine( "Adding a DiscoveryClientResult to the collection..." );
      DiscoveryClientResult^ myDiscoveryClientResult = gcnew DiscoveryClientResult;

      // Set the DiscoveryDocumentReference class as the type of 
      // reference in the discovery document.
      myDiscoveryClientResult->ReferenceTypeName =
         "System.Web.Services.Discovery.DiscoveryDocumentReference";

      // Set the URL for the reference.
      myDiscoveryClientResult->Url = "http://localhost/Discovery/Service1_cs.asmx?disco";

      // Set the name of the file in which the reference is saved.
      myDiscoveryClientResult->Filename = "Service1_cs.disco";

      // Add myDiscoveryClientResult to the collection.
      myDiscoveryClientResultCollection->Add( myDiscoveryClientResult );
      if ( myDiscoveryClientResultCollection->Contains( myDiscoveryClientResult ) )
      {
         Console::WriteLine( "Instance of DiscoveryClientResult found in the Collection" );
      }
   }
   catch ( Exception^ ex ) 
   {
      Console::WriteLine( "Error is {0}", ex->Message );
   }
}
Язык J#
import System.*;
import System.Reflection.*;
import System.IO.*;
import System.Web.Services.Discovery.*;
import System.Xml.Schema.*;
import System.Collections.*;

public class MyDiscoveryClientResult
{
    public static void main(String[] args)
    {
        try {
            DiscoveryClientProtocol myDiscoveryClientProtocol = 
                new DiscoveryClientProtocol();

            // Get the collection of DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection =
                myDiscoveryClientProtocol.ReadAll("results.discomap");

            Console.WriteLine("Removing a DiscoveryClientResult from the "
                + "collection...");

            // Remove the first DiscoveryClientResult from the collection.
            myDiscoveryClientResultCollection.Remove(
                myDiscoveryClientResultCollection.get_Item(0));
            Console.WriteLine("Adding a DiscoveryClientResult" 
                + " to the collection...");

            DiscoveryClientResult myDiscoveryClientResult = 
                new DiscoveryClientResult();

            // Set the DiscoveryDocumentReference class as the type of 
            // reference in the discovery document.
            myDiscoveryClientResult.set_ReferenceTypeName(
                "System.Web.Services.Discovery.DiscoveryDocumentReference");

            // Set the URL for the reference.
            myDiscoveryClientResult.set_Url(
                "http://localhost/Discovery/Service1_jsl.asmx?disco");

            // Set the name of the file in which the reference is saved.
            myDiscoveryClientResult.set_Filename("Service1_jsl.disco");

            // Add myDiscoveryClientResult to the collection.
            myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
            if (myDiscoveryClientResultCollection.
                Contains(myDiscoveryClientResult)) {
                Console.WriteLine("Instance of DiscoveryClientResult found "
                    + "in the Collection");
            }
        }
        catch (System.Exception ex) {
            Console.WriteLine("Error is " + ex.get_Message());
        }
    } //main
} //MyDiscoveryClientResult
Иерархия наследования

System..::.Object
  System.Collections..::.CollectionBase
    System.Web.Services.Discovery..::.DiscoveryClientResultCollection
Потокобезопасность

Любые открытые члены этого типа, объявленные как static (Shared в Visual Basic), являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.
Платформы

Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 с пакетом обновления 4 (SP4), Windows Millennium Edition, Windows 98

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии

.NET Framework

Поддерживается в версиях: 3.5, 3.0, 2.0, 1.1, 1.0
См. также

Ссылки

Теги :


Page view tracker