DiscoveryReferenceCollection クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DiscoveryReferenceCollection クラスの意味・解説 

DiscoveryReferenceCollection クラス

探索され参照コレクション。このクラス継承できません。

名前空間: System.Web.Services.Discovery
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public NotInheritable Class
 DiscoveryReferenceCollection
    Inherits CollectionBase
Dim instance As DiscoveryReferenceCollection
public sealed class DiscoveryReferenceCollection
 : CollectionBase
public ref class DiscoveryReferenceCollection
 sealed : public CollectionBase
public final class DiscoveryReferenceCollection
 extends CollectionBase
public final class DiscoveryReferenceCollection
 extends CollectionBase
使用例使用例
Imports System
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 occured : " +
 e.Message)
   End Try
   End Sub

End Class
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());
   }
}
#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
 );
}
import System.*;
import System.IO.*;
import System.Web.Services.Discovery.*;

class MyDiscoveryDocumentClass
{
    public static void main(String[]
 args) throws Exception 
    {
        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: " 
            + ((Int32)myDiscoveryReferenceCollection.get_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: "
            + ((Int32)myDiscoveryReferenceCollection.get_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.get_Item(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: " 
            + ((Int32)myDiscoveryReferenceCollection.get_Count()).ToString());
    } //main
} //MyDiscoveryDocumentClass
継承階層継承階層
System.Object
   System.Collections.CollectionBase
    System.Web.Services.Discovery.DiscoveryReferenceCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DiscoveryReferenceCollection メンバ
System.Web.Services.Discovery 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DiscoveryReferenceCollection クラス」の関連用語

DiscoveryReferenceCollection クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DiscoveryReferenceCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS