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.
Afficher le fichier Open project: platformdotnet/Platform

Private Properties

Свойство Type Description
HasAquiredTaskState bool
OnRequestedTaskStateChanged void
OnTaskStateChanged void
Start void

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
SetRequestedTaskState ( TaskState value ) : void

Private Methods

Méthode 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 méthode

public InitializeRun ( string defaultThreadName ) : void
defaultThreadName string
Résultat void

ProcessTaskStateRequest() public méthode

public ProcessTaskStateRequest ( ) : void
Résultat void

RequestTaskState() public méthode

public RequestTaskState ( TaskState state ) : bool
state TaskState
Résultat bool

RequestTaskState() public méthode

public RequestTaskState ( TaskState state, System.TimeSpan timeout ) : bool
state TaskState
timeout System.TimeSpan
Résultat bool

SetRequestedTaskState() protected méthode

protected SetRequestedTaskState ( TaskState value ) : void
value TaskState
Résultat void

SetTaskState() public méthode

public SetTaskState ( TaskState newState ) : void
newState TaskState
Résultat void

TaskAsyncStateAndImplementationHelper() public méthode

public TaskAsyncStateAndImplementationHelper ( ITask task ) : System
task ITask
Résultat System