Share via


ImportCollection クラス

定義

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

public ref class ImportCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class ImportCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type ImportCollection = class
    inherit ServiceDescriptionBaseCollection
Public NotInheritable Class ImportCollection
Inherits ServiceDescriptionBaseCollection
継承

次の例では、クラスの一般的な使用方法を ImportCollection 示します。

#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." );
   }
}
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.");
      }
   }
}
Imports System.Web.Services.Description
Imports System.Xml

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
End Class

注釈

このクラスはImport、ルート<definitions>要素で囲まれた Web サービス記述言語 (WSDL) <import> 要素に対応します。 WSDL の詳細については、WSDL 仕様を参照してください。

プロパティ

Capacity

CollectionBase に格納できる要素の数を取得または設定します。

(継承元 CollectionBase)
Count

CollectionBase インスタンスに含まれる要素の数を取得します。 このプロパティはオーバーライドできません。

(継承元 CollectionBase)
InnerList

ArrayList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)
Item[Int32]

指定した 0 から始まるインデックス番号にある Import の値を取得または設定します。

List

IList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)
Table

ServiceDescriptionBaseCollection 内のキーと値の関連付けを実装するインターフェイスを取得します。

(継承元 ServiceDescriptionBaseCollection)

メソッド

Add(Import)

指定した ImportImportCollection の末尾に追加します。

Clear()

CollectionBase インスタンスからすべてのオブジェクトを削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
Contains(Import)

指定した ImportImportCollection のメンバーかどうかを示す値を返します。

CopyTo(Import[], Int32)

ImportCollection 全体を互換性のある Import 型の 1 次元配列にコピーします。コピーは、コピー先の配列の、指定した 0 から始まるインデックス番号から開始します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

CollectionBase インスタンスを反復処理する列挙子を返します。

(継承元 CollectionBase)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetKey(Object)

参照によって渡された値に関連付けられているキーの名前を返します。

(継承元 ServiceDescriptionBaseCollection)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(Import)

指定した Import を検索し、コレクション内で最初に見つかった位置の 0 から始まるインデックス番号を返します。

Insert(Int32, Import)

指定した 0 から始まるインデックス番号にある Import に、指定した ImportCollection インスタンスを追加します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnClear()

ServiceDescriptionBaseCollection インスタンスの内容を消去します。

(継承元 ServiceDescriptionBaseCollection)
OnClearComplete()

CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsert(Int32, Object)

CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsertComplete(Int32, Object)

ServiceDescriptionBaseCollection に新しい要素を挿入した後に、追加のカスタム プロセスを実行します。

(継承元 ServiceDescriptionBaseCollection)
OnRemove(Int32, Object)

ServiceDescriptionBaseCollection から要素を削除します。

(継承元 ServiceDescriptionBaseCollection)
OnRemoveComplete(Int32, Object)

CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnSet(Int32, Object, Object)

値を ServiceDescriptionBaseCollection 内の別の値に置き換えます。

(継承元 ServiceDescriptionBaseCollection)
OnSetComplete(Int32, Object, Object)

CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnValidate(Object)

値を検証するときに、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
Remove(Import)

Import 内で最初に見つかった指定の ImportCollection を削除します。

RemoveAt(Int32)

CollectionBase インスタンスの指定したインデックスにある要素を削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
SetParent(Object, Object)

ServiceDescriptionBaseCollection インスタンスの親オブジェクトを設定します。

(継承元 ServiceDescriptionBaseCollection)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

CollectionBase 全体を互換性のある 1 次元の 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 全体内で最初に見つかった位置の 0 から始まるインデックスを返します。

(継承元 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)

IEnumerableIQueryable に変換します。

適用対象

こちらもご覧ください