언어

PipelineComponentInfos.Contains(Object) 메서드

정의

컬렉션 내 항목이 예외를 던지지 않고 인덱싱을 통해 접근할 수 있는지 나타내는 불리언을 반환합니다.

public:
 bool Contains(System::Object ^ index);
public bool Contains(object index);
member this.Contains : obj -> bool
Public Function Contains (index As Object) As Boolean

매개 변수

index
Object

컬렉션에서 찾을 객체의 PipelineComponentInfo 이름, 식별자, ID 또는 인덱스

반품

이름, 신원, ID 또는 인덱스로 컬렉션에 접근할 수 있는지 나타내는 불리언입니다. true가 있으면 PipelineComponentInfos [index]라는 구문을 사용하여 컬렉션에 접근할 수 있음을 나타냅니다. false 값은 인덱싱을 사용해 컬렉션에서 PipelineComponentInfos 항목을 가져올 수 없음을 나타냅니다; 이 속성을 사용하면 예외가 발생합니다.

예제

다음 코드 샘플은 "Merge"라는 이름의 파이프라인 컴포넌트가 컬렉션에 있는지 확인하는 메서드를 사용합니다 Contains . 이 메서드는 .Boolean

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;  

            // Search the collection by name.  
            if (pInfos.Contains("Merge"))  
                Console.WriteLine("The collection contains {0} pipeline component", pInfos[0].Name);  
            else  
                Console.WriteLine("The collection does not contain {0} pipeline component", pInfos[0].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   

            ' Search the collection by name.  
            If pInfos.Contains("Merge") Then  
                Console.WriteLine("The collection contains {0} pipeline component", pInfos(0).Name)  
            Else   
                Console.WriteLine("The collection does not contain {0} pipeline component", pInfos(0).Name)  
            End If  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

이 컬렉션에는 Merge pipeline 구성 요소가 포함되어 있습니다

적용 대상