C# Class Platform.AbstractTask.TaskAsyncStateAndImplementationHelper

Helper struct for implementing ITask
This class is useful for implementers of ITask which don't or can't extend AbstractTask. The class stores state and provides algorithms for safely transitioning between task states.
Exibir arquivo Open project: platformdotnet/Platform

Private Properties

Property Type Description
HasAquiredTaskState bool
OnRequestedTaskStateChanged void
OnTaskStateChanged void
Start void

Public Methods

Method Description
InitializeRun ( string defaultThreadName ) : void
ProcessTaskStateRequest ( ) : void
RequestTaskState ( TaskState state ) : bool
RequestTaskState ( TaskState state, System.TimeSpan timeout ) : bool
SetTaskState ( TaskState newState ) : void

TaskAsyncStateAndImplementationHelper ( ITask task ) : System

Protected Methods

Method Description
SetRequestedTaskState ( TaskState value ) : void

Private Methods

Method Description
HasAquiredTaskState ( TaskState state ) : bool
OnRequestedTaskStateChanged ( Platform.TaskEventArgs eventArgs ) : void

Raises the RequestedTaskStateChanged event.

OnTaskStateChanged ( Platform.TaskEventArgs eventArgs ) : void

Raises the TaskStateChanged event.

Start ( System.TimeSpan waitTimeOut ) : void

Method Details

InitializeRun() public method

public InitializeRun ( string defaultThreadName ) : void
defaultThreadName string
return void

ProcessTaskStateRequest() public method

public ProcessTaskStateRequest ( ) : void
return void

RequestTaskState() public method

public RequestTaskState ( TaskState state ) : bool
state TaskState
return bool

RequestTaskState() public method

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

SetRequestedTaskState() protected method

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

SetTaskState() public method

public SetTaskState ( TaskState newState ) : void
newState TaskState
return void

TaskAsyncStateAndImplementationHelper() public method

public TaskAsyncStateAndImplementationHelper ( ITask task ) : System
task ITask
return System