SqlTrackingWorkflowInstance.Initialized 属性

定义

获取或设置一个指示时间的 DateTime,工作流运行时引擎在该时间请求了此工作流实例的第一个 TrackingChannelGets or sets a DateTime that indicates the time at which the first TrackingChannel for this workflow instance was requested by the workflow run-time engine.

public:
 property DateTime Initialized { DateTime get(); void set(DateTime value); };
public DateTime Initialized { get; set; }
member this.Initialized : DateTime with get, set
Public Property Initialized As DateTime

属性值

DateTime

一个指示时间的 DateTime,工作流运行时引擎在该时间请求了此工作流实例的第一个 TrackingChannelA DateTime that indicates the time at which the first TrackingChannel for this workflow instance was requested by the workflow run-time engine.

示例

下面的代码示例演示如何获取有关所显示工作流的列表中包含的所有 SqlTrackingWorkflowInstance 对象的信息。The following code example shows how to obtain information about all SqlTrackingWorkflowInstance objects contained in a list of displayed workflows. 代码为 ListViewItem 变量中的每个 SqlTrackingWorkflowInstance 创建一个 displayedWorkflowsThe code creates a ListViewItem for each SqlTrackingWorkflowInstance found in a displayedWorkflows variable. 每个 ListViewItem 都包含 WorkflowInstanceInternalIdWorkflowTypeStatus 属性的字符串表示形式。Each ListViewItem contains a string representation of the WorkflowInstanceInternalId, the WorkflowType and Status properties. 然后,它将该项添加到 workflowStatusListIt then adds the item to a workflowStatusList. 代码使用以前命名的属性值和 Initialized 属性的字符串版本来创建同样会添加到 WorkflowStatusInfo 的新 workflowStatusList 对象。The code uses the previously named property values and a string version of the Initialized property to create a new WorkflowStatusInfo object that is also added to the workflowStatusList.

此代码示例摘自 Mainform.cs 文件中的工作流监视器 SDK 示例。This code example is part of the Workflow Monitor SDK Sample from the Mainform.cs file. 有关详细信息,请参阅 工作流监视器For more information, see Workflow Monitor.

static void WriteTerminatedEventArgs(string eventDescription, TrackingWorkflowTerminatedEventArgs terminatedEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nTerminated Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != terminatedEventArgs.Exception)
    {
        Console.WriteLine("TerminatedEventArgs Exception Message: " + terminatedEventArgs.Exception.Message.ToString());
    }
}
Shared Sub WriteTerminatedEventArgs(ByVal eventDescription As String, ByVal terminatedEventArgs As TrackingWorkflowTerminatedEventArgs, ByVal eventDataTime As DateTime)
    Console.WriteLine(vbCrLf + "Terminated Event Arguments Read From Tracking Database:")
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString(CultureInfo.CurrentCulture))
    Console.WriteLine("EventDescription: " + eventDescription)
    If terminatedEventArgs.Exception IsNot Nothing Then
        Console.WriteLine("TerminatedEventArgs Exception Message: " + terminatedEventArgs.Exception.Message.ToString())
    End If
End Sub

适用于