WorkflowApplication.BeginCancel 方法

定義

使用 IAsyncResult 非同步設計模式,以非同步方式取消工作流程。Cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern.

多載

BeginCancel(AsyncCallback, Object)

使用指定的 AsyncCallback 和使用者提供的狀態,以非同步方式取消工作流程執行個體。Cancels a workflow instance asynchronously using the specified AsyncCallback and user-provided state.

BeginCancel(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、AsyncCallback 和使用者提供的狀態,以非同步方式取消工作流程執行個體。Cancels a workflow instance asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.

備註

如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

BeginCancel(AsyncCallback, Object)

使用指定的 AsyncCallback 和使用者提供的狀態,以非同步方式取消工作流程執行個體。Cancels a workflow instance asynchronously using the specified AsyncCallback and user-provided state.

public:
 IAsyncResult ^ BeginCancel(AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginCancel (AsyncCallback callback, object state);
member this.BeginCancel : AsyncCallback * obj -> IAsyncResult
Public Function BeginCancel (callback As AsyncCallback, state As Object) As IAsyncResult

參數

callback
AsyncCallback

取消作業完成時要呼叫的方法。The method to be called when the cancel operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步取消作業的參考。A reference to the asynchronous cancel operation.

備註

若要判斷取消作業是否成功,請呼叫EndCancelTo determine whether the cancel operation was successful, call EndCancel. EndCancel 可以從 callback 方法之內或之外呼叫。EndCancel can be called from inside or outside of the callback method. 如果在取消作業完成之前呼叫 EndCancel,它會封鎖直到取消作業完成為止。If EndCancel is called before the cancel operation completes, it blocks until the cancel operation completes. 根據預設,取消作業必須在 30 秒內完成,否則會從 TimeoutException 擲回 EndCancelBy default, the cancel operation must complete in 30 seconds or a TimeoutException is thrown from EndCancel.

這個方法會使用 IAsyncResult 非同步設計模式來非同步取消工作流程。This method cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

BeginCancel(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、AsyncCallback 和使用者提供的狀態,以非同步方式取消工作流程執行個體。Cancels a workflow instance asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.

public:
 IAsyncResult ^ BeginCancel(TimeSpan timeout, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginCancel (TimeSpan timeout, AsyncCallback callback, object state);
member this.BeginCancel : TimeSpan * AsyncCallback * obj -> IAsyncResult
Public Function BeginCancel (timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult

參數

timeout
TimeSpan

取消作業必須在作業取消並擲回 TimeoutException 前完成的間隔。The interval in which the cancel operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

取消作業完成時要呼叫的方法。The method to be called when the cancel operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步取消作業的參考。A reference to the asynchronous cancel operation.

備註

若要判斷取消作業是否成功,請呼叫EndCancelTo determine whether the cancel operation was successful, call EndCancel. EndCancel 可以從 callback 參數中指定的方法之內或之外呼叫。EndCancel can be called from inside or outside of the method specified in the callback parameter. 如果在取消作業完成之前呼叫 EndCancel,它會封鎖直到取消作業完成為止。If EndCancel is called before the cancel operation completes, it blocks until the cancel operation completes. 如果取消作業沒有在 timeOut 參數指定的間隔內完成,則會從 TimeoutException 擲回 EndCancelIf the cancel operation does not complete in the interval specified by the timeOut parameter, a TimeoutException is thrown from EndCancel.

這個方法會使用 IAsyncResult 非同步設計模式來非同步取消工作流程。This method cancels a workflow asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

適用於