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 处理程序。

适用于