Compartilhar via


IEventActivity.Subscribe Método

Definição

Cria a assinatura de um Activity a um evento.

public:
 void Subscribe(System::Workflow::ComponentModel::ActivityExecutionContext ^ parentContext, System::Workflow::ComponentModel::IActivityEventListener<System::Workflow::ComponentModel::QueueEventArgs ^> ^ parentEventHandler);
public void Subscribe (System.Workflow.ComponentModel.ActivityExecutionContext parentContext, System.Workflow.ComponentModel.IActivityEventListener<System.Workflow.ComponentModel.QueueEventArgs> parentEventHandler);
abstract member Subscribe : System.Workflow.ComponentModel.ActivityExecutionContext * System.Workflow.ComponentModel.IActivityEventListener<System.Workflow.ComponentModel.QueueEventArgs> -> unit
Public Sub Subscribe (parentContext As ActivityExecutionContext, parentEventHandler As IActivityEventListener(Of QueueEventArgs))

Parâmetros

parentContext
ActivityExecutionContext

O ActivityExecutionContext que representa o ambiente de execução do Activity.

parentEventHandler
IActivityEventListener<QueueEventArgs>

O EventHandler para o evento pai.

Exemplos

O exemplo de código a seguir mostra como usar o método Subscribe. Este exemplo de código faz parte do Exemplo de SDK do FileWatcher do arquivo FileSystemEvent.cs. Para obter mais informações, consulte Atividade do Observador do Sistema de Arquivos.

// Create EventHandlers for the WorkflowRuntime
workflowRuntime.WorkflowTerminated += new EventHandler<WorkflowTerminatedEventArgs>(WorkflowRuntime_WorkflowTerminated);
' Create EventHandlers for the WorkflowRuntime
AddHandler workflowRuntime.WorkflowTerminated, AddressOf WorkflowRuntime_WorkflowTerminated

Aplica-se a