Task 생성자

정의

Task 클래스의 새 인스턴스를 초기화합니다.

protected:
 Task();
protected Task ();
Protected Sub New ()

예제

다음 코드 샘플에서는 생성자를 사용하여 새 BulkInsertTask 코드를 만듭니다.

BulkInsertTask myTask = new BulkInsertTask();  
Dim myTask As BulkInsertTask =  New BulkInsertTask()  

설명

상속 Task되는 작업의 경우 각 태스크의 예제 섹션에 있는 코드 예제에서는 작업 생성자를 호출하는 방법을 보여 줍니다. 그러나 대부분의 경우 태스크를 패키지의 멤버로 만듭니다. 작업 캐스팅에 대한 자세한 내용은 의 발언을 참조하세요 Add.

Package pkg = new Package();  
Executable exec1 = pkg.Executables.Add("STOCK:BulkInsertTask");  
TaskHost th = exec1 as TaskHost;  
// You can cast the InnerObject of the TaskHost  
// to the specific class.  
// For the code samples, the task properties are accessed using  
// the Properties of the TaskHost.  
//BulkInsertTask myTask = th.InnerObject as BulkInsertTask;  
Dim pkg As Package =  New Package()   
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:BulkInsertTask")   
Dim th As TaskHost =  exec1 as TaskHost   
' You can cast the InnerObject of the TaskHost  
' to the specific class.  
' For the code samples, the task properties are accessed using  
' the Properties of the TaskHost.  
'BulkInsertTask myTask = th.InnerObject as BulkInsertTask;  

변수thBulkInsertTask 사용하여 속성 및 메서드를 TaskHost 사용할 수 있습니다.

적용 대상