共用方式為


DiscoveryClientResultCollection 類別

定義

包含 DiscoveryClientResult 物件的集合。 此類別無法獲得繼承。

public ref class DiscoveryClientResultCollection sealed : System::Collections::CollectionBase
public sealed class DiscoveryClientResultCollection : System.Collections.CollectionBase
type DiscoveryClientResultCollection = class
    inherit CollectionBase
Public NotInheritable Class DiscoveryClientResultCollection
Inherits CollectionBase
繼承
DiscoveryClientResultCollection

範例

#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 );
   }
}
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);
      }
   }
}
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
End Class

建構函式

DiscoveryClientResultCollection()

初始化 DiscoveryClientResultCollection 類別的新執行個體。

屬性

Capacity

取得或設定 CollectionBase 可包含的項目數目。

(繼承來源 CollectionBase)
Count

取得 CollectionBase 執行個體中包含的元素數目。 這個屬性無法覆寫。

(繼承來源 CollectionBase)
InnerList

取得包含 ArrayList 執行個體中之元素清單的 CollectionBase

(繼承來源 CollectionBase)
Item[Int32]

取得或設定位於 DiscoveryClientResulti 位置的 DiscoveryClientResultCollection

List

取得包含 IList 執行個體中之元素清單的 CollectionBase

(繼承來源 CollectionBase)

方法

Add(DiscoveryClientResult)

DiscoveryClientResult 加入至 DiscoveryClientResultCollection

Clear()

CollectionBase 執行個體移除所有的物件。 無法覆寫這個方法。

(繼承來源 CollectionBase)
Contains(DiscoveryClientResult)

判斷 DiscoveryClientResultCollection 是否包含特定 DiscoveryClientResult

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

傳回可逐一查看 CollectionBase 執行個體的列舉值。

(繼承來源 CollectionBase)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnClear()

在清除 CollectionBase 執行個體的內容之後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnClearComplete()

在清除 CollectionBase 執行個體的內容後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnInsert(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體前,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnInsertComplete(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnRemove(Int32, Object)

當從 CollectionBase 執行個體移除元素時,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnRemoveComplete(Int32, Object)

在從 CollectionBase 執行個體移除元素後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnSet(Int32, Object, Object)

CollectionBase 執行個體中設定數值前,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnSetComplete(Int32, Object, Object)

CollectionBase 執行個體中設定數值後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnValidate(Object)

當驗證數值時,執行額外的自訂處理序。

(繼承來源 CollectionBase)
Remove(DiscoveryClientResult)

移除 DiscoveryClientResult 中,特定 DiscoveryClientResultCollection 的第一個項目。

RemoveAt(Int32)

移除 CollectionBase 執行個體之指定索引的元素。 這個方法不可覆寫。

(繼承來源 CollectionBase)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 CollectionBase 複製到相容的一維 Array

(繼承來源 CollectionBase)
ICollection.IsSynchronized

取得值,這個值表示對 CollectionBase 的存取是否同步 (安全執行緒)。

(繼承來源 CollectionBase)
ICollection.SyncRoot

取得可用以同步存取 CollectionBase 的物件。

(繼承來源 CollectionBase)
IList.Add(Object)

將物件加入至 CollectionBase 的末端。

(繼承來源 CollectionBase)
IList.Contains(Object)

判斷 CollectionBase 是否包含特定項目。

(繼承來源 CollectionBase)
IList.IndexOf(Object)

搜尋指定的 Object,並傳回在整個 CollectionBase 中第一個符合項目之以零為起始的索引。

(繼承來源 CollectionBase)
IList.Insert(Int32, Object)

將項目插入至 CollectionBase 中指定的索引位置。

(繼承來源 CollectionBase)
IList.IsFixedSize

取得值,指出 CollectionBase 是否有固定的大小。

(繼承來源 CollectionBase)
IList.IsReadOnly

取得值,指出 CollectionBase 是否唯讀。

(繼承來源 CollectionBase)
IList.Item[Int32]

在指定的索引位置上取得或設定項目。

(繼承來源 CollectionBase)
IList.Remove(Object)

CollectionBase 移除特定物件之第一個符合的元素。

(繼承來源 CollectionBase)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱