C# Class Platform.AbstractTask

Provides a base class for objects that can be started, stopped and paused. The class provides support for accepting and processing messages to perform task operations such as Start() and Stop()
Inheritance: ITask
Show file Open project: platformdotnet/Platform

Private Properties

Property Type Description

Public Methods

Method Description
CanRequestTaskState ( TaskState taskState ) : bool
DoRun ( ) : void
GetTaskThread ( ) : Thread
Pause ( ) : void
RequestTaskState ( TaskState taskState, System.TimeSpan timeout ) : bool
RequestTaskState ( TaskState taskState ) : void
Resume ( ) : void
Run ( ) : void
SetTaskThread ( Thread value ) : void
Start ( ) : void
Stop ( ) : void

Protected Methods

Method Description
AbstractTask ( ) : System

Create a new AbstractTask

InitializeRun ( ) : void
OnTaskException ( TaskExceptionEventArgs eventArgs ) : void

Raises the TaskException event.

ProcessTaskStateRequest ( ) : void
SetRequestedTaskState ( TaskState taskState ) : void
SetTaskState ( TaskState value ) : void
Sleep ( System.TimeSpan timeout ) : void
Sleep ( int timeout ) : void

Method Details

AbstractTask() protected method

Create a new AbstractTask
protected AbstractTask ( ) : System
return System

CanRequestTaskState() public method

public CanRequestTaskState ( TaskState taskState ) : bool
taskState TaskState
return bool

DoRun() public abstract method

public abstract DoRun ( ) : void
return void

GetTaskThread() public method

public GetTaskThread ( ) : Thread
return Thread

InitializeRun() protected method

protected InitializeRun ( ) : void
return void

OnTaskException() protected method

Raises the TaskException event.
protected OnTaskException ( TaskExceptionEventArgs eventArgs ) : void
eventArgs TaskExceptionEventArgs The that contains the event data.
return void

Pause() public method

public Pause ( ) : void
return void

ProcessTaskStateRequest() protected method

protected ProcessTaskStateRequest ( ) : void
return void

RequestTaskState() public method

public RequestTaskState ( TaskState taskState, System.TimeSpan timeout ) : bool
taskState TaskState
timeout System.TimeSpan
return bool

RequestTaskState() public method

public RequestTaskState ( TaskState taskState ) : void
taskState TaskState
return void

Resume() public method

public Resume ( ) : void
return void

Run() public method

public Run ( ) : void
return void

SetRequestedTaskState() protected method

protected SetRequestedTaskState ( TaskState taskState ) : void
taskState TaskState
return void

SetTaskState() protected method

protected SetTaskState ( TaskState value ) : void
value TaskState
return void

SetTaskThread() public method

public SetTaskThread ( Thread value ) : void
value Thread
return void

Sleep() protected method

protected Sleep ( System.TimeSpan timeout ) : void
timeout System.TimeSpan
return void

Sleep() protected method

protected Sleep ( int timeout ) : void
timeout int
return void

Start() public method

public Start ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void