Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UnregisterForQueueItemAvailable Method

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
)

Parameters

eventListener
Type: System.Workflow.ComponentModel.IActivityEventListener<QueueEventArgs>
A subscriber for QueueEventArgs that implements the IActivityEventListener<T> interface.

ExceptionCondition
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);
}


.NET Framework

Supported in: 4, 3.5, 3.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft