C# 클래스 Nexus.Client.ThreadedBackgroundTask

A base class for tasks that run in a background thread.
This class implements some base functionality, making writing backgounrd tasks simpler. This class handles running the task in a thread. To implement the background task, you must provide a public method that calls one of the Start or StartWait methods. If threading management is not desired, use BackgroundTask instead.
상속: BackgroundTask
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5

공개 메소드들

메소드 설명
ThreadedBackgroundTask ( ) : System

The default constructor.

보호된 메소드들

메소드 설명
DoWork ( object p_objArgs ) : object

The method that is called to start the backgound task.

DoWork ( object p_objArgs, string &p_strMessage ) : object

The method that is called to start the backgound task.

OnTaskEnded ( TaskEndedEventArgs e ) : void

Raises the IBackgroundTask.TaskEnded event.

This signals the StartWait(bool, object[]) method that the task has ended, and makes the return value accessible to said method.

Start ( ) : void

Starts the task in a foreground thread.

Start ( bool p_booRunInBackground ) : void

Starts the task, optionally in a background thread.

If the task is started in a background thread, the task will be terminated in the calling thread terminates. Otherwise, the calling thread will not terminate until the task completes.

StartWait ( ) : object

Starts the task in a foreground thread, and waits until the task completes.

StartWait ( bool p_booRunInBackground ) : object

Starts the task, optionally in a background thread, and waits until the task completes.

If the task is started in a background thread, the task will be terminated in the calling thread terminates. Otherwise, the calling thread will not terminate until the task completes.

비공개 메소드들

메소드 설명
EndThreadInvokeHandler ( IAsyncResult p_asrResult ) : void

The callback use by the BeginInvoke method that runs the work in the background.

RunThread ( object p_objArgs ) : void

A wrapper to the work method called by the thread to start the work.

RunThreadedWork ( object p_objArgs ) : object

메소드 상세

DoWork() 보호된 메소드

The method that is called to start the backgound task.
protected DoWork ( object p_objArgs ) : object
p_objArgs object Arguments to for the task execution.
리턴 object

DoWork() 보호된 메소드

The method that is called to start the backgound task.
protected DoWork ( object p_objArgs, string &p_strMessage ) : object
p_objArgs object Arguments to for the task execution.
p_strMessage string The message describing the state of the task.
리턴 object

OnTaskEnded() 보호된 메소드

Raises the IBackgroundTask.TaskEnded event.
This signals the StartWait(bool, object[]) method that the task has ended, and makes the return value accessible to said method.
protected OnTaskEnded ( TaskEndedEventArgs e ) : void
e Nexus.Client.BackgroundTasks.TaskEndedEventArgs A describing the event arguments.
리턴 void

Start() 보호된 메소드

Starts the task in a foreground thread.
protected Start ( ) : void
리턴 void

Start() 보호된 메소드

Starts the task, optionally in a background thread.
If the task is started in a background thread, the task will be terminated in the calling thread terminates. Otherwise, the calling thread will not terminate until the task completes.
protected Start ( bool p_booRunInBackground ) : void
p_booRunInBackground bool Whether the task should be run in a background thread.
리턴 void

StartWait() 보호된 메소드

Starts the task in a foreground thread, and waits until the task completes.
protected StartWait ( ) : object
리턴 object

StartWait() 보호된 메소드

Starts the task, optionally in a background thread, and waits until the task completes.
If the task is started in a background thread, the task will be terminated in the calling thread terminates. Otherwise, the calling thread will not terminate until the task completes.
protected StartWait ( bool p_booRunInBackground ) : object
p_booRunInBackground bool Whether the task should be run in a background thread.
리턴 object

ThreadedBackgroundTask() 공개 메소드

The default constructor.
public ThreadedBackgroundTask ( ) : System
리턴 System