WorkflowQueuingService 類別

定義

警告

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

提供管理 WorkflowQueue 物件的服務。

public ref class WorkflowQueuingService
public class WorkflowQueuingService
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class WorkflowQueuingService
type WorkflowQueuingService = class
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type WorkflowQueuingService = class
Public Class WorkflowQueuingService
繼承
WorkflowQueuingService
屬性

範例

下列程式碼範例將示範名為 CreateQueue 的方法,此方法透過呼叫 WorkflowQueuingService 方法來初始化 ActivityExecutionContext.GetService 物件。 然後,此程式碼會使用 Exists 方法來判斷具有指定名稱的 WorkflowQueue 是否存在。 如果不存在,程式碼會呼叫 CreateWorkflowQueue 方法,否則呼叫 GetWorkflowQueue 方法。

這個程式碼範例是 FileSystemEvent.cs 檔案中<檔案監看員活動 SDK>範例的一部分。 如需詳細資訊,請參閱 檔案系統監看員活動

private WorkflowQueue CreateQueue(ActivityExecutionContext context)
{
    Console.WriteLine("CreateQueue");
    WorkflowQueuingService qService = context.GetService<WorkflowQueuingService>();

    if (!qService.Exists(this.QueueName))
    {
        qService.CreateWorkflowQueue(this.QueueName, true);
    }

    return qService.GetWorkflowQueue(this.QueueName);
}
Private Function CreateQueue(ByVal context As ActivityExecutionContext) As WorkflowQueue
    Console.WriteLine("CreateQueue")
    Dim qService As WorkflowQueuingService = context.GetService(Of WorkflowQueuingService)()

    If Not qService.Exists(Me.queueName) Then
        qService.CreateWorkflowQueue(Me.queueName, True)
    End If

    Return qService.GetWorkflowQueue(Me.QueueName)
End Function

備註

注意

此資料討論已被汰換的類型及命名空間。 如需詳細資訊,請參閱 Windows Workflow Foundation 4.5 中即將淘汰的類型

WorkflowQueuingService 提供的方法,可以讓您用於管理與工作流程執行個體關聯的工作流程佇列。

欄位

PendingMessagesProperty
已淘汰.

包含與此 WorkflowQueuingService 關聯之工作流程佇列中的未使用項目。

方法

CreateWorkflowQueue(IComparable, Boolean)
已淘汰.

使用指定的名稱和交易範圍建立 WorkflowQueue

DeleteWorkflowQueue(IComparable)
已淘汰.

刪除指定的 WorkflowQueue

Equals(Object)
已淘汰.

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

(繼承來源 Object)
Exists(IComparable)
已淘汰.

測試指定的 WorkflowQueue 是否存在。

GetHashCode()
已淘汰.

做為預設雜湊函式。

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

取得目前執行個體的 Type

(繼承來源 Object)
GetWorkflowQueue(IComparable)
已淘汰.

擷取指定的 WorkflowQueue

MemberwiseClone()
已淘汰.

建立目前 Object 的淺層複製。

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

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

(繼承來源 Object)

適用於

另請參閱