本文整理匯總了C#中System.Activities.WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId屬性的典型用法代碼示例。如果您正苦於以下問題:C# WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId屬性的具體用法?C# WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId怎麽用?C# WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Activities.WorkflowApplicationUnhandledExceptionEventArgs
的用法示例。
在下文中一共展示了WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ApplicationException
Activity wf = new Sequence
{
Activities =
{
new WriteLine
{
Text = "Starting the workflow."
},
new Throw
{
Exception = new InArgument<Exception>((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
{
Text = "Ending the workflow."
}
}
};
WorkflowApplication wfApp = new WorkflowApplication(wf);
wfApp.OnUnhandledException = delegate(WorkflowApplicationUnhandledExceptionEventArgs e)
{
// Display the unhandled exception.
Console.WriteLine("OnUnhandledException in Workflow {0}\n{1}",
e.InstanceId, e.UnhandledException.Message);
Console.WriteLine("ExceptionSource: {0} - {1}",
e.ExceptionSource.DisplayName, e.ExceptionSourceInstanceId);
// Instruct the runtime to terminate the workflow.
return UnhandledExceptionAction.Terminate;
// Other choices are UnhandledExceptionAction.Abort and
// UnhandledExceptionAction.Cancel
};
wfApp.Run();
開發者ID:.NET開發者,項目名稱:System.Activities,代碼行數:39,代碼來源:WorkflowApplicationUnhandledExceptionEventArgs.ExceptionSourceInstanceId