WorkflowApplication.Aborted 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當工作流程實例中止時,會被呼叫或設定 Action<T> that。
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 不會呼叫處理器。