TrackingWorkflowExceptionEventArgs 類別

定義

警告:已過時

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

包含工作流程執行個體執行期間所發生之例外狀況的相關資料。Contains data associated with an exception that occurs during the execution of a workflow instance.

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 的方法,該方法會擷取 TrackingWorkflowExceptionEventArgsThe following code example demonstrates a method, named WriteExceptionEventArgs, which captures a TrackingWorkflowExceptionEventArgs. 程式碼會檢查 Exception 屬性是否為 null (Visual Basic 中的 Nothing)。The code checks whether the Exception property is null (Nothing in Visual Basic).

如果不是,程式碼會將與 Exception 屬性關聯的訊息寫入主控台。If it is not, the code writes the message associated with the Exception property to the console. 此外,程式碼會將 OriginalActivityPath 屬性的值轉換成字串並寫入主控台中。In addition, the code converts the value of the OriginalActivityPath property to a string and writes it to the console.

這個程式碼範例是 Program.cs 檔案中<EventArgs 追蹤 SDK>範例的一部分。This code example is part of the EventArgs Tracking SDK sample from the Program.cs file. 如需詳細資訊,請參閱 EventArgs 追蹤範例For more information, see EventArgs Tracking Sample.

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

備註

注意

此資料討論已被汰換的類型及命名空間。This material discusses types and namespaces that are obsolete. 如需詳細資訊,請參閱 Windows Workflow Foundation 4.5 中即將淘汰的類型For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

當工作流程執行個體執行期間發生例外狀況,而且與工作流程執行個體關聯的 TrackingProfile 包含為 WorkflowTrackPoint 設定的 TrackingWorkflowEvent.Exception 時,工作流程追蹤基礎結構會在傳送至追蹤服務的 EventArgs 中將 TrackingWorkflowExceptionEventArgs 設定成 WorkflowTrackingRecordWhen an exception occurs during the execution of a workflow instance and a TrackingProfile that is associated with the workflow instance includes a WorkflowTrackPoint configured for a TrackingWorkflowEvent.Exception, the workflow tracking infrastructure sets EventArgs to an TrackingWorkflowExceptionEventArgs in the WorkflowTrackingRecord that it sends to the tracking service.

注意

只有執行階段追蹤服務會使用 TrackingWorkflowExceptionEventArgs,在 WorkflowTrackingRecord 中傳遞資訊。TrackingWorkflowExceptionEventArgs is used only by the runtime tracking service to pass information in a WorkflowTrackingRecord.

屬性

ContextGuid

取得關聯活動的內容識別碼。Gets the context ID of the associated activity.

CurrentActivityPath

取得目前擲回例外狀況之活動的 QualifiedNameGets the QualifiedName of the activity currently throwing the exception.

Exception

取得由工作流程執行個體擲回的 ExceptionGets the Exception that is being thrown by the workflow instance.

OriginalActivityPath

取得原先擲回例外狀況之活動的 QualifiedNameGets the QualifiedName of the activity that originally threw the exception.

ParentContextGuid

取得父活動的內容識別碼。Gets the context ID of the parent activity.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱