共用方式為


IEventActivity.Unsubscribe 方法

定義

取消 Activity 對事件的訂閱。

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

參數

parentContext
ActivityExecutionContext

ActivityExecutionContext,表示 Activity 的執行環境。

parentEventHandler
IActivityEventListener<QueueEventArgs>

父事件的 EventHandler

備註

下列程式碼範例示範如何使用 Unsubscribe 方法。 這個程式碼範例是 FileSystemEvent.cs 檔案中<檔案監看員活動 SDK>範例的一部分。 如需詳細資訊,請參閱 文件系統監看員活動

// Add an instance of the External Data Exchange Service
ExternalDataExchangeService externalDataExchangeService = new ExternalDataExchangeService();
workflowRuntime.AddService(externalDataExchangeService);
' Add an instance of the External Data Exchange Service
Dim externalDataExchange As New ExternalDataExchangeService()
workflowRuntime.AddService(externalDataExchange)

適用於