言語

PipelineComponentInfoEnumerator.Current プロパティ

定義

コレクションから現在の PipelineComponentInfo 要素を取得します。

public:
 property Microsoft::SqlServer::Dts::Runtime::PipelineComponentInfo ^ Current { Microsoft::SqlServer::Dts::Runtime::PipelineComponentInfo ^ get(); };
public Microsoft.SqlServer.Dts.Runtime.PipelineComponentInfo Current { get; }
member this.Current : Microsoft.SqlServer.Dts.Runtime.PipelineComponentInfo
Public ReadOnly Property Current As PipelineComponentInfo

プロパティ値

コレクション内の現在の PipelineComponentInfo 要素。

以下のコードサンプルでは、列挙子を作成し、 Current およびMoveNextメソッドを使ってコレクションをナビゲートします。

[C#]

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace TaskInfos_Item  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            PipelineComponentInfos pInfos = app.PipelineComponentInfos;  

            //Create the Enumerator.  
            PipelineComponentInfoEnumerator myEnumerator= pInfos.GetEnumerator();  
            Console.WriteLine("The collection contains the following values:");  
            int i = 0;  
            while ((myEnuemrator.MoveNext()) && (myEnuemrator.Current != null))  
                Console.WriteLine("[{0}] {1}", i++, myEnuemrator.Current.Name);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace TaskInfos_Item  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim pInfos As PipelineComponentInfos =  app.PipelineComponentInfos   

            'Create the Enumerator.  
            Dim myEnumeratorAs PipelineComponentInfoEnumerator =  pInfos.GetEnumerator()   
            Console.WriteLine("The collection contains the following values:")  
            Dim i As Integer =  0   
            While (myEnuemrator.MoveNext()) &&(myEnuemrator.Current <> Nothing)  
            Console.WriteLine("[{0}] {1}",i = Console.WriteLine("[{0}] {1}",i + 1  
            End While  
        End Sub  
    End Class  
End Namespace  

出力例:

コレクションには以下の値が含まれています:

[0] 合流

[1] マージ ジョイン

[2] 検索

[3] 監査

[4] ロウサンプリング

[5] 次元処理

[6] 用語抽出

[7] データマイニングモデルトレーニング

[8] OLE DBソース

[9] キャラクターマップ

[10] ファジーグルーピング

注釈

列挙子が作成された後、またはResetメソッドに呼び出した後、列挙子がCurrentプロパティの値を読み取る前に、MoveNextメソッドを呼び出してコレクションの最初の要素に進めなければなりません;そうでなければ、Currentは未定義となり例外が投げられます。

Current また、 MoveNext の最後の呼び出しが false返された場合も例外がスローされます。これはコレクションの末尾を示します。

Currentは列挙子の位置を移動せず、CurrentまたはMoveNextが呼び出されるまで、Resetの連続した呼び出しは同じオブジェクトを返します。

列挙子は、コレクションが変更されない限り有効なままです。 コレクションに要素の追加、修正、削除などの変更が加えられると、列挙子は無効化され回復不能になります。そのため、次に MoveNextReset に電話をかけると InvalidOperationExceptionが投げられます。 しかし、 MoveNextCurrentの呼び出し間でコレクションが変更されると、 Current は列挙子が無効化されていても、設定された要素を返します。

適用対象