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

ImportCollection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

プロジェクト内のすべての Import 要素コレクション表します

名前空間: Microsoft.Build.BuildEngine
アセンブリ: Microsoft.Build.Engine (microsoft.build.engine.dll 内)
構文構文

Public Class ImportCollection
    Implements ICollection, IEnumerable
Dim instance As ImportCollection
public class ImportCollection : ICollection,
 IEnumerable
public ref class ImportCollection : ICollection,
 IEnumerable
public class ImportCollection implements ICollection,
 IEnumerable
public class ImportCollection implements ICollection,
 IEnumerable
継承階層継承階層
System.Object
  Microsoft.Build.BuildEngine.ImportCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImportCollection メンバ
Microsoft.Build.BuildEngine 名前空間

ImportCollection クラス

XML Web サービスインポートされるドキュメントを表す Import クラスインスタンスコレクション提供します。このクラス継承できません。

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

Public NotInheritable Class
 ImportCollection
    Inherits ServiceDescriptionBaseCollection
Dim instance As ImportCollection
public sealed class ImportCollection : ServiceDescriptionBaseCollection
public ref class ImportCollection sealed :
 public ServiceDescriptionBaseCollection
public final class ImportCollection extends
 ServiceDescriptionBaseCollection
public final class ImportCollection extends
 ServiceDescriptionBaseCollection
解説解説
使用例使用例

ImportCollection クラス一般的な使用例を次に示します

Imports System
Imports System.Web.Services.Description
Imports System.Xml
Imports Microsoft.VisualBasic

Class ServiceDescription_ImportCollection
   Public Shared Sub Main()
      Dim myServiceDescription As ServiceDescription
 = _
                              ServiceDescription.Read("StockQuoteService_vb.wsdl")
      Console.WriteLine(" ImportCollection Sample ")
      ' Get Import Collection.
      Dim myImportCollection As ImportCollection
 = myServiceDescription.Imports
      Console.WriteLine("Total Imports in the document = "
 + _
                        myServiceDescription.Imports.Count.ToString())
      ' Print 'Import' properties to console.
      Dim i As Integer
      For i = 0 To myImportCollection.Count
 - 1
         Console.WriteLine(ControlChars.Tab + _
                           "Import Namespace :{0} Import Location
 :{1} ", _
                           myImportCollection(i).Namespace, _
                           myImportCollection(i).Location)
      Next i

      Dim myImports(myServiceDescription.Imports.Count - 1) As
 Import
      ' Copy 'ImportCollection' to an array.
      myServiceDescription.Imports.CopyTo(myImports, 0)
      Console.WriteLine("Imports that are copied to Importarray
 ...")
      Dim j As Integer
      For j = 0 To myImports.Length - 1
         Console.WriteLine(ControlChars.Tab + _
                           "Import Namespace :{0} Import Location
 :{1} ", _
                           myImports(j).Namespace, myImports(j).Location)
      Next j

      ' Get Import by Index.
      Dim myImport As Import = _
            myServiceDescription.Imports(myServiceDescription.Imports.Count - 1)
      Console.WriteLine("Import by Index...")
      If myImportCollection.Contains(myImport) Then
         Console.WriteLine("Import Namespace '"
 + myImport.Namespace + _
                           "' is found in 'ImportCollection'.")
         Console.WriteLine("Index of '"
 + myImport.Namespace + _
                           "' in 'ImportCollection' = " +
 _
                           myImportCollection.IndexOf(myImport).ToString())
         Console.WriteLine("Delete Import from 'ImportCollection'...")
         myImportCollection.Remove(myImport)
         If myImportCollection.IndexOf(myImport) = - 1 Then
            Console.WriteLine("Import is successfully removed
 from Import Collection.")
         End If
      End If
   End Sub 'Main
End Class 'ServiceDescription_ImportCollection
 
using System;
using System.Web.Services.Description;
using System.Xml;

class ServiceDescription_ImportCollection
{
   public static void Main()
   {
      ServiceDescription myServiceDescription = ServiceDescription.Read("StockQuoteService_cs.wsdl");
      Console.WriteLine(" ImportCollection Sample ");
      // Get Import Collection.
      ImportCollection myImportCollection = myServiceDescription.Imports;
      Console.WriteLine("Total Imports in the document =
 " + myServiceDescription.Imports.Count);
      // Print 'Import' properties to console.
      for(int i =0; i < myImportCollection.Count;
 ++i)
         Console.WriteLine("\tImport Namespace :{0} Import Location :{1} "
                                       ,myImportCollection[i].Namespace
                                       ,myImportCollection[i].Location);
      Import[] myImports = new Import[myServiceDescription.Imports.Count];
      // Copy 'ImportCollection' to an array.
      myServiceDescription.Imports.CopyTo(myImports,0);
      Console.WriteLine("Imports that are copied to Importarray ...");
      for(int i=0;i < myImports.Length;
 ++i)
         Console.WriteLine("\tImport Namespace :{0} Import Location :{1} "
                                                ,myImports[i].Namespace
                                                ,myImports[i].Location);
      // Get Import by Index.
      Import myImport = myServiceDescription.Imports[myServiceDescription.Imports.Count-1];
      Console.WriteLine("Import by Index...");
      if (myImportCollection.Contains(myImport))
      {
         Console.WriteLine("Import Namespace '"
                  + myImport.Namespace + "' is found in 'ImportCollection'.");
         Console.WriteLine("Index of '" + myImport.Namespace + "'
 in 'ImportCollection' = "
                                                   + myImportCollection.IndexOf(myImport));
         Console.WriteLine("Deleting Import from 'ImportCollection'...");
         myImportCollection.Remove(myImport);
         if(myImportCollection.IndexOf(myImport) == -1)
            Console.WriteLine("Import is successfully removed from Import Collection.");
      }
   }
}
#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Xml;
int main()
{
   ServiceDescription^ myServiceDescription = ServiceDescription::Read( "StockQuoteService_cpp.wsdl"
 );
   Console::WriteLine( " ImportCollection Sample " );
   
   // Get Import Collection.
   ImportCollection^ myImportCollection = myServiceDescription->Imports;
   Console::WriteLine( "Total Imports in the document = {0}",
 myServiceDescription->Imports->Count );
   
   // Print 'Import' properties to console.
   for ( int i = 0; i < myImportCollection->Count;
 ++i )
      Console::WriteLine( "\tImport Namespace : {0} Import Location : {1} "
,
         myImportCollection[ i ]->Namespace, myImportCollection[ i ]->Location
 );

   array<Import^>^myImports = gcnew array<Import^>(myServiceDescription->Imports->Count);
   
   // Copy 'ImportCollection' to an array.
   myServiceDescription->Imports->CopyTo( myImports, 0 );
   Console::WriteLine( "Imports that are copied to Importarray ..." );
   for ( int i = 0; i < myImports->Length;
 ++i )
      Console::WriteLine( "\tImport Namespace : {0} Import Location : {1} "
,
         myImports[ i ]->Namespace, myImports[ i ]->Location );

   // Get Import by Index.
   Import^ myImport = myServiceDescription->Imports[ myServiceDescription->Imports->Count
 - 1 ];
   Console::WriteLine( "Import by Index..." );
   if ( myImportCollection->Contains( myImport ) )
   {
      Console::WriteLine( "Import Namespace ' {0} ' is found in
 'ImportCollection'.", myImport->Namespace );
      Console::WriteLine( "Index of '{0}' in 'ImportCollection'
 = {1}",
         myImport->Namespace, myImportCollection->IndexOf( myImport ) );
      Console::WriteLine( "Deleting Import from 'ImportCollection'..."
 );
      myImportCollection->Remove( myImport );
      if ( myImportCollection->IndexOf( myImport ) == -1 )
            Console::WriteLine( "Import is successfully removed from Import
 Collection." );
   }
}

import System.*;
import System.Web.Services.Description.*;
import System.Xml.*;

class ServiceDescriptionImportCollection
{
    public static void main(String[]
 args)
    {
        ServiceDescription myServiceDescription 
            = ServiceDescription.Read("StockQuoteService_jsl.wsdl");
        Console.WriteLine(" ImportCollection Sample ");

        // Get Import Collection.
        ImportCollection myImportCollection 
            = myServiceDescription.get_Imports();

        Console.WriteLine("Total Imports in the document
 = " 
            + myServiceDescription.get_Imports().get_Count());

        // Print 'Import' properties to console.
        for (int i = 0; i < myImportCollection.get_Count();
 ++i) {
            Console.WriteLine("\tImport Namespace :{0} Import Location :{1}
 ",
                myImportCollection.get_Item(i).get_Namespace(),
                myImportCollection.get_Item(i).get_Location());
        }

        Import myImports[] = new Import[myServiceDescription.
            get_Imports().get_Count()];

        // Copy 'ImportCollection' to an array.
        myServiceDescription.get_Imports().CopyTo(myImports, 0);
        Console.WriteLine("Imports that are copied to Importarray ...");
        for (int i = 0; i < myImports.length;
 ++i) {
            Console.WriteLine("\tImport Namespace :{0} Import Location :{1}
 ",
                myImports[i].get_Namespace(), myImports[i].get_Location());
        }

        // Get Import by Index.
        Import myImport = myServiceDescription.get_Imports().
            get_Item(myServiceDescription.get_Imports().get_Count() - 1);

        Console.WriteLine("Import by Index...");
        if (myImportCollection.Contains(myImport)) {
            Console.WriteLine("Import Namespace '" + myImport.get_Namespace()
 
                + "' is found in 'ImportCollection'.");
            Console.WriteLine("Index of '" + myImport.get_Namespace() 
                + "' in 'ImportCollection' = " 
                + myImportCollection.IndexOf(myImport));
            Console.WriteLine("Deleting Import from 'ImportCollection'...");
            myImportCollection.Remove(myImport);
            if (myImportCollection.IndexOf(myImport) == -1) {
                Console.WriteLine(
                    "Import is successfully removed from Import Collection.");
            }
        }
    } //main
} //ServiceDescriptionImportCollection 
継承階層継承階層
System.Object
   System.Collections.CollectionBase
     System.Web.Services.Description.ServiceDescriptionBaseCollection
      System.Web.Services.Description.ImportCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImportCollection メンバ
System.Web.Services.Description 名前空間
Import クラス



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

辞書ショートカット

すべての辞書の索引

「ImportCollection クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS