Home > Backend Development > C#.Net Tutorial > Background worker class in C#

Background worker class in C#

WBOY
Release: 2023-09-03 23:33:02
forward
1816 people have browsed it

C# 中的后台工作者类

As the name suggests, the Background Worker class allows you to set up a thread that runs continuously in the background and communicates with the main thread when needed.

BackgroundWorker implements threads in Windows Forms. Intensive tasks need to be done on another thread so that the UI doesn't freeze. After the task is completed it is necessary to publish a message and update the user interface.

The following properties are used in the BackgroundWorker class:

Reference: Microsoft Developer Network (MSDN)

##12345 tr>6789
Serial number Name & Description

CancellationPending Value indicating whether the application requests cancellation of background operations.

td>

CanRaiseEvents strong>Gets a value indicating whether the component can raise events

ContainerGet the IContainer containing the component.

DesignModeGets a value indicating whether the component is currently in design model. (Inherited from Component.)

EventGet the event attached to this component List of event handlers.

IsBusy p>Gets a value indicating whether the BackgroundWorker is running an asynchronous operation.

SiteGets or sets the ISite of the component.

WorkerReportsProgressGets or sets a value indicating whether the BackgroundWorker can report progress renew.

WorkerSupportsCancellationGets or sets a value indicating whether the BackgroundWorker supports asynchronous cancellation.

The above is the detailed content of Background worker class in C#. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template