Właściwość PipelineComponentInfos.Item
Zwraca PipelineComponentInfo obiekt z kolekcja.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public ReadOnly Default Property Item ( _
index As Object _
) As PipelineComponentInfo
Get
'Użycie
Dim instance As PipelineComponentInfos
Dim index As Object
Dim value As PipelineComponentInfo
value = instance(index)
public PipelineComponentInfo this[
Object index
] { get; }
public:
property PipelineComponentInfo^ default[Object^ index] {
PipelineComponentInfo^ get (Object^ index);
}
member Item : PipelineComponentInfo
Język JScript obsługuje używanie indeksowanych właściwości, ale nie obsługuje deklarowania nowych.
Parametry
- index
Typ: System.Object
Nazwę, identyfikator, opis lub indeks element zlokalizować kolekcja.
Wartość właściwości
Typ: Microsoft.SqlServer.Dts.Runtime.PipelineComponentInfo
A PipelineComponentInfo obiektu.
Uwagi
Jeśli wywołanie Contains Metoda zwraca true, określonego elementu kolekcja można uzyskać dostęp za pomocą składni PipelineComponentInfos[index].Jednakże jeśli Contains Metoda zwraca false, ta właściwość zgłasza wyjątek.W języku C#, ta właściwość jest indeksowanie dla PipelineComponentInfos klasy
Przykłady
Poniższy przykład kodu pobiera element z kolekcja, używając dwóch metod.Pierwszy metoda używa pInfos[…] składni, aby pobrać cały obiekt znajdujący się na pierwszym miejscu gromadzenia i umieścić go w pInfo obiektu.Można teraz pobrać wszystkie właściwości z pInfo obiektu w zwykły sposób.Druga metoda demonstruje sposób pobrać określoną właściwość opis z "merge" obiekt kolekcja, przy użyciu nazwy jako indeksatora.
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
Przykładowe dane wyjściowe:
Opis zapisu korespondencji seryjnej: Scalanie transformacji