共用方式為


WorkflowApplication.Aborted 屬性

定義

取得或設定終止工作流程執行個體時叫用的 Action<T>

public:
 property Action<System::Activities::WorkflowApplicationAbortedEventArgs ^> ^ Aborted { Action<System::Activities::WorkflowApplicationAbortedEventArgs ^> ^ get(); void set(Action<System::Activities::WorkflowApplicationAbortedEventArgs ^> ^ value); };
public Action<System.Activities.WorkflowApplicationAbortedEventArgs> Aborted { get; set; }
member this.Aborted : Action<System.Activities.WorkflowApplicationAbortedEventArgs> with get, set
Public Property Aborted As Action(Of WorkflowApplicationAbortedEventArgs)

屬性值

終止工作流程執行個體時叫用的動作。

範例

下列程式碼範例會檢查傳遞給 WorkflowApplicationAbortedEventArgs 執行個體之 Aborted 處理常式的 WorkflowApplication,並且顯示工作流程中止原因的相關資訊。

wfApp.Aborted = delegate(WorkflowApplicationAbortedEventArgs e)
{
    // Display the exception that caused the workflow
    // to abort.
    Console.WriteLine("Workflow {0} Aborted.", e.InstanceId);
    Console.WriteLine("Exception: {0}\n{1}",
        e.Reason.GetType().FullName,
        e.Reason.Message);
};

備註

WorkflowApplication 所裝載的工作流程已中止時,系統就會叫用 Aborted 處理常式,而不會叫用 Completed 處理常式。

適用於