Aracılığıyla paylaş


WorkflowQueuingService.GetWorkflowQueue(IComparable) Yöntem

Tanım

Belirtilen WorkflowQueueöğesini alır.

public:
 System::Workflow::Runtime::WorkflowQueue ^ GetWorkflowQueue(IComparable ^ queueName);
public System.Workflow.Runtime.WorkflowQueue GetWorkflowQueue (IComparable queueName);
member this.GetWorkflowQueue : IComparable -> System.Workflow.Runtime.WorkflowQueue
Public Function GetWorkflowQueue (queueName As IComparable) As WorkflowQueue

Parametreler

queueName
IComparable

Alınacak öğesinin WorkflowQueue adı.

Döndürülenler

Bir WorkflowQueue nesnesi.

Özel durumlar

queueName bir null başvurudur (Nothing Visual Basic'te).

Belirtilen WorkflowQueue bulunamadı.

Örnekler

Aşağıdaki kod örneği, yöntemini çağırarak ActivityExecutionContext.GetService bir nesnesi başlatan adlı CreateQueuebir WorkflowQueuingService yöntemi gösterir. Kod daha sonra belirtilen ada sahip bir WorkflowQueue öğesinin Exists mevcut olup olmadığını belirlemek için yöntemini kullanır. Yoksa, kod yöntemini çağırır CreateWorkflowQueue ; varsa kod yöntemini çağırır GetWorkflowQueue .

Bu kod örneği, FileSystemEvent.cs dosyasındaki Dosya İzleyicisi Etkinlik SDK Örneği'nin bir parçasıdır. Daha fazla bilgi için bkz. Dosya Sistemi İzleyicisi Etkinliği.

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

Şunlara uygulanır

Ayrıca bkz.