This topic has not yet been rated - Rate this topic

WorkflowQueue.UnregisterForQueueItemAvailable Method

Unregisters a subscriber to the QueueItemAvailable event.

Namespace: System.Workflow.Runtime
Assembly: System.Workflow.Runtime (in system.workflow.runtime.dll)

public void UnregisterForQueueItemAvailable (
	IActivityEventListener<QueueEventArgs> eventListener
)
public void UnregisterForQueueItemAvailable (
	IActivityEventListener<QueueEventArgs> eventListener
)
public function UnregisterForQueueItemAvailable (
	eventListener : IActivityEventListener<QueueEventArgs>
)
Not applicable.

Parameters

eventListener

A subscriber for QueueEventArgs that implements the IActivityEventListener interface.

Exception typeCondition

ArgumentNullException

eventListener is a null reference (Nothing in Visual Basic).

The following code example demonstrates how you can create a WorkflowQueue by calling the WorkflowQueuingService.GetWorkflowQueue method. It also uses the UnregisterForQueueItemAvailable to unregister the specified listener.

This code example is part of the File Watcher Activity SDK Sample from the FileSystemEvent.cs file. For more information, see File System Watcher Activity.

private void DoUnsubscribe(ActivityExecutionContext context, IActivityEventListener<QueueEventArgs> listener)
{
    if (!this.subscriptionId.Equals(Guid.Empty))
    {
        FileWatcherService fileService = context.GetService<FileWatcherService>();
        fileService.UnregisterListener(this.subscriptionId);
        this.subscriptionId = Guid.Empty;
    }

    WorkflowQueuingService qService = context.GetService<WorkflowQueuingService>();
    WorkflowQueue queue = qService.GetWorkflowQueue(this.QueueName);

    queue.UnregisterForQueueItemAvailable(listener);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.