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
已淘汰.

取得關聯活動的內容識別碼。

CurrentActivityPath
已淘汰.

取得目前擲回例外狀況之活動的 QualifiedName

Exception
已淘汰.

取得由工作流程執行個體擲回的 Exception

OriginalActivityPath
已淘汰.

取得原先擲回例外狀況之活動的 QualifiedName

ParentContextGuid
已淘汰.

取得父活動的內容識別碼。

方法

Equals(Object)
已淘汰.

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()
已淘汰.

做為預設雜湊函式。

(繼承來源 Object)
GetType()
已淘汰.

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()
已淘汰.

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()
已淘汰.

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱