TrackingWorkflowExceptionEventArgs 类

定义

注意

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

包含与工作流实例执行过程中发生的异常关联的数据。

public ref class TrackingWorkflowExceptionEventArgs : EventArgs
[System.Serializable]
public class TrackingWorkflowExceptionEventArgs : EventArgs
[System.Serializable]
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class TrackingWorkflowExceptionEventArgs : EventArgs
[<System.Serializable>]
type TrackingWorkflowExceptionEventArgs = class
    inherit EventArgs
[<System.Serializable>]
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type TrackingWorkflowExceptionEventArgs = class
    inherit EventArgs
Public Class TrackingWorkflowExceptionEventArgs
Inherits EventArgs
继承
TrackingWorkflowExceptionEventArgs
属性

示例

下面的代码示例演示一个名为 WriteExceptionEventArgs 的方法,该方法可捕获 TrackingWorkflowExceptionEventArgs。 代码将检查 Exception 属性是否为 null(在 Visual Basic 中为 Nothing)。

如果不是,代码会将与 Exception 属性关联的消息写入控制台。 此外,代码会将 OriginalActivityPath 属性的值转换为字符串,并将其写入控制台。

此代码示例摘自 Program.cs 文件中的 EventArgs 跟踪 SDK 示例。 有关详细信息,请参阅 EventArgs 跟踪示例

static void WriteExceptionEventArgs(string eventDescription, TrackingWorkflowExceptionEventArgs exceptionEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nException Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != exceptionEventArgs.Exception)
    {
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString());
    }
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString());
}
Shared Sub WriteExceptionEventArgs(ByVal eventDescription As String, ByVal exceptionEventArgs As TrackingWorkflowExceptionEventArgs, ByVal eventDataTime As DateTime)
    Console.WriteLine(vbCrLf + "Exception Event Arguments Read From Tracking Database:")
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString(CultureInfo.CurrentCulture))
    Console.WriteLine("EventDescription: " + eventDescription)
    If exceptionEventArgs.Exception IsNot Nothing Then
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString())
    End If
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString())
End Sub

注解

注意

本材料讨论的类型和命名空间已废弃不用。 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型

当工作流实例执行过程中发生异常,并且与该工作流实例关联的 TrackingProfile 包括针对 WorkflowTrackPoint 配置的 TrackingWorkflowEvent.Exception 时,工作流跟踪基础结构会在它发送到跟踪服务的 EventArgs 中将 TrackingWorkflowExceptionEventArgs 设置为 WorkflowTrackingRecord

注意

TrackingWorkflowExceptionEventArgs 仅由运行时跟踪服务使用,以在 WorkflowTrackingRecord 中传递信息。

属性

ContextGuid
已过时.

获取关联的活动的上下文 ID。

CurrentActivityPath
已过时.

获取当前引发异常的活动的 QualifiedName

Exception
已过时.

获取工作流实例所引发的 Exception

OriginalActivityPath
已过时.

获取原来引发异常的活动的 QualifiedName

ParentContextGuid
已过时.

获取父活动的上下文 ID。

方法

Equals(Object)
已过时.

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()
已过时.

作为默认哈希函数。

(继承自 Object)
GetType()
已过时.

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()
已过时.

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()
已过时.

返回表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅