Task Construtor

Definição

Inicializa uma nova instância da classe Task.

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

Exemplos

O exemplo de código a seguir cria um novo BulkInsertTask usando o construtor.

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

Comentários

Para tarefas que herdam, o exemplo de Taskcódigo na seção Exemplo de cada tarefa mostra como chamar o construtor de tarefas. No entanto, na maioria dos casos, você criará a tarefa como membro de um pacote. Para obter mais informações sobre como lançar a tarefa, consulte os comentários em 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;  

As propriedades e os BulkInsertTask métodos estão disponíveis usando a TaskHost variável. th

Aplica-se a