PipelineComponentInfos.Item[Object] プロパティ

定義

PipelineComponentInfo オブジェクトをコレクションから返します。

public:
 property Microsoft::SqlServer::Dts::Runtime::PipelineComponentInfo ^ default[System::Object ^] { Microsoft::SqlServer::Dts::Runtime::PipelineComponentInfo ^ get(System::Object ^ index); };
public Microsoft.SqlServer.Dts.Runtime.PipelineComponentInfo this[object index] { get; }
member this.Item(obj) : Microsoft.SqlServer.Dts.Runtime.PipelineComponentInfo
Default Public ReadOnly Property Item(index As Object) As PipelineComponentInfo

パラメーター

index
Object

コレクション内で検索する項目の名前、ID、説明、またはインデックスです。

プロパティ値

PipelineComponentInfo

PipelineComponentInfo オブジェクト。

次のコード例では、2 つのメソッドを使用して、コレクションから項目を取得します。 最初のメソッドでは、構文を pInfos[…] 使用して、コレクションの最初の位置にあるオブジェクト全体を取得し、オブジェクトに pInfo 配置します。 これによって、pInfo オブジェクトのすべてのプロパティを通常どおり取得できるようになります。 2 番目のメソッドでは、名前をインデクサーとして使用して、コレクションの merge オブジェクトから description プロパティを取得します。

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;  

            //Using the Item method syntax of [x], obtain the description  
            // of the Merge entry.  
            PipelineComponentInfo pInfo = pInfos["Merge"];  
            String nameOfFirstItem = pInfos["Merge"].Description;  
            Console.WriteLine("Description of Merge entry: {0}", nameOfFirstItem);  
        }  
    }  
}  
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   

            'Using the Item method syntax of [x], obtain the description  
            ' of the Merge entry.  
            Dim pInfo As PipelineComponentInfo =  pInfos("Merge")   
            Dim nameOfFirstItem As String =  pInfos("Merge").Description   
            Console.WriteLine("Description of Merge entry: {0}", nameOfFirstItem)  
        End Sub  
    End Class  
End Namespace  

サンプル出力:

Description of Merge entry: Merge Transformation

注釈

メソッドの呼び出しが Containstrueされた場合は、構文 PipelineComponentInfos[index]を使用してコレクション内の指定された要素にアクセスできます。 ただし、Contains メソッドから false が返される場合、このプロパティは例外をスローします。 C# では、このプロパティはクラスのインデクサー PipelineComponentInfos です

適用対象