Show / Hide Table of Contents

Class QueuedBackgroundWorker

A background worker with a work queue.

Inheritance
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
QueuedBackgroundWorker
Implements
System.ComponentModel.IComponent
System.IDisposable
Inherited Members
System.ComponentModel.Component.Dispose()
System.ComponentModel.Component.GetService(System.Type)
System.ComponentModel.Component.ToString()
System.ComponentModel.Component.CanRaiseEvents
System.ComponentModel.Component.Events
System.ComponentModel.Component.Site
System.ComponentModel.Component.Container
System.ComponentModel.Component.DesignMode
System.ComponentModel.Component.Disposed
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.CreateObjRef(System.Type)
Namespace: Manina.Windows.Forms
Assembly: ImageListView.dll
Syntax
[ToolboxBitmap(typeof(QueuedBackgroundWorker))]
public class QueuedBackgroundWorker : Component, IComponent, IDisposable

Constructors

| Improve this Doc View Source

QueuedBackgroundWorker()

Initializes a new instance of the QueuedBackgroundWorker class.

Declaration
public QueuedBackgroundWorker()

Properties

| Improve this Doc View Source

IsBackground

Gets or sets a value indicating whether or not the worker thread is a background thread.

Declaration
[Browsable(true)]
public bool IsBackground { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PriorityQueues

Gets or sets the number of priority queues. Number of queues cannot be changed after any work is added to the work queue.

Declaration
[Browsable(true)]
public int PriorityQueues { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ProcessingMode

Represents the mode in which the work items are processed. Processing mode cannot be changed after any work is added to the work queue.

Declaration
[Browsable(true)]
public ProcessingMode ProcessingMode { get; set; }
Property Value
Type Description
ProcessingMode
| Improve this Doc View Source

Started

Determines whether the QueuedBackgroundWorker started working.

Declaration
[Browsable(false)]
public bool Started { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ThreadName

Represents the name of the worker threads.

Declaration
[Browsable(true)]
public string ThreadName { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Threads

Gets or sets the number of worker threads. Number of threads cannot be changed after any work is added to the work queue.

Declaration
[Browsable(true)]
public int Threads { get; set; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

CancelAsync()

Cancels all pending operations in all queues.

Declaration
public void CancelAsync()
| Improve this Doc View Source

CancelAsync(Int32)

Cancels all pending operations in the given queue.

Declaration
public void CancelAsync(int priority)
Parameters
Type Name Description
System.Int32 priority

A value between 0 and PriorityQueues indicating the priority queue to cancel.

| Improve this Doc View Source

CancelAsync(Object)

Cancels processing the item with the given key.

Declaration
public void CancelAsync(object argument)
Parameters
Type Name Description
System.Object argument

The argument of an asynchronous operation.

| Improve this Doc View Source

Dispose(Boolean)

Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Overrides
System.ComponentModel.Component.Dispose(System.Boolean)
| Improve this Doc View Source

GetApartmentState()

Gets the apartment state of worker threads.

Declaration
public ApartmentState GetApartmentState()
Returns
Type Description
System.Threading.ApartmentState

The apartment state of worker threads.

| Improve this Doc View Source

OnDoWork(QueuedWorkerDoWorkEventArgs)

Raises the DoWork event.

Declaration
protected virtual void OnDoWork(QueuedWorkerDoWorkEventArgs e)
Parameters
Type Name Description
QueuedWorkerDoWorkEventArgs e

A QueuedWorkerDoWorkEventArgs that contains event data.

| Improve this Doc View Source

OnRunWorkerCompleted(QueuedWorkerCompletedEventArgs)

Raises the RunWorkerCompleted event.

Declaration
protected virtual void OnRunWorkerCompleted(QueuedWorkerCompletedEventArgs e)
Parameters
Type Name Description
QueuedWorkerCompletedEventArgs e

A QueuedWorkerCompletedEventArgs that contains event data.

| Improve this Doc View Source

Pause()

Pauses the worker.

Declaration
public void Pause()
| Improve this Doc View Source

Resume()

Resumes processing pending operations in the work queue.

Declaration
public void Resume()
| Improve this Doc View Source

RunWorkerAsync()

Starts processing a new background operation.

Declaration
public void RunWorkerAsync()
| Improve this Doc View Source

RunWorkerAsync(Object)

Starts processing a new background operation.

Declaration
public void RunWorkerAsync(object argument)
Parameters
Type Name Description
System.Object argument

The argument of an asynchronous operation.

| Improve this Doc View Source

RunWorkerAsync(Object, Int32)

Starts processing a new background operation.

Declaration
public void RunWorkerAsync(object argument, int priority)
Parameters
Type Name Description
System.Object argument

The argument of an asynchronous operation.

System.Int32 priority

A value between 0 and PriorityQueues indicating the priority of this item. An item with a higher priority will be processed before items with lower priority.

| Improve this Doc View Source

RunWorkerAsync(Object, Int32, Boolean)

Starts processing a new background operation.

Declaration
public void RunWorkerAsync(object argument, int priority, bool single)
Parameters
Type Name Description
System.Object argument

The argument of an asynchronous operation.

System.Int32 priority

A value between 0 and PriorityQueues indicating the priority of this item. An item with a higher priority will be processed before items with lower priority.

System.Boolean single

true to run this operation without waiting for queued items; otherwise false to add this operatino to th queue.

| Improve this Doc View Source

SetApartmentState(ApartmentState)

Sets the apartment state of worker threads. The apartment state cannot be changed after any work is added to the work queue.

Declaration
public void SetApartmentState(ApartmentState state)
Parameters
Type Name Description
System.Threading.ApartmentState state

The new state of worker threads.

Events

| Improve this Doc View Source

DoWork

Occurs when RunWorkerAsync(Object, Int32) is called.

Declaration
[Browsable(true)]
public event QueuedWorkerDoWorkEventHandler DoWork
Event Type
Type Description
Manina.Windows.Forms.QueuedWorkerDoWorkEventHandler
| Improve this Doc View Source

RunWorkerCompleted

Occurs when the background operation of an item has completed, has been canceled, or has raised an exception.

Declaration
[Browsable(true)]
public event RunQueuedWorkerCompletedEventHandler RunWorkerCompleted
Event Type
Type Description
Manina.Windows.Forms.RunQueuedWorkerCompletedEventHandler

Implements

System.ComponentModel.IComponent
System.IDisposable
Back to top Copyright © 2018 Özgür Özçıtak