Share via


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)

适用于

另请参阅