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

コレクション内にある現在の 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  

サンプル出力:

The collection contains the following values:

[0] Merge

[1] Merge Join

[2] Lookup

[3] Audit

[4] Row Sampling

[5] Dimension Processing

[6] Term Extraction

[7] Data Mining Model Training

[8] OLE DB Source

[9] Character Map

[10] Fuzzy Grouping

注釈

列挙子が作成された後、またはメソッドの Reset 呼び出し後に、 MoveNext 列挙子がプロパティの値を読み取る前に、列挙子をコレクションの最初の要素に進めるためにメソッドを呼び出す必要があります。それ以外の Current 場合は未定義であり、 Current 例外がスローされます。

前回の MoveNext の呼び出しで false が返された場合 (コレクションの末尾であることを示します)、その後で Current を呼び出しても例外がスローされます。

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

列挙子は、コレクションが変更されない限り有効です。 要素の追加、変更、削除など、コレクションに変更が加えられた場合、列挙子は無効になり、回復不能になります。したがって、次の呼び出しは MoveNextResetInvalidOperationException. ただし、コレクションが呼び出しと呼び出しCurrentの間でMoveNext変更された場合、Current列挙子が無効になっている場合でも、設定されている要素が返されます。

適用対象