Table of Contents

Class CoTask

Namespace
ReFuel
Assembly
ReFuel.Common.dll

A task that executes with cooperative multitasking.

public abstract class CoTask
Inheritance
CoTask
Derived
Inherited Members

Constructors

CoTask()

public CoTask()

Properties

Exception

The exception that terminated the task.

public Exception? Exception { get; }

Property Value

Exception

InitialState

protected abstract Action InitialState { get; }

Property Value

Action

IsComplete

True when the task is complete.

public bool IsComplete { get; }

Property Value

bool

IsSuccessful

True when the task successfully completed.

public bool IsSuccessful { get; }

Property Value

bool

State

The Current task state.

public MethodInfo State { get; }

Property Value

MethodInfo

Methods

Advance()

Advance the task into the next state.

public bool Advance()

Returns

bool

True if the task completed.

Advance(IEnumerable<CoTask>)

Advance all tasks.

public static IEnumerable<CoTask> Advance(IEnumerable<CoTask> tasks)

Parameters

tasks IEnumerable<CoTask>

The tasks to advance.

Returns

IEnumerable<CoTask>

Tasks that completed.

Fail()

Finish the task unsuccessfully.

protected void Fail()

Finish()

Finish the task successfully.

protected void Finish()

Next(Action)

Advance to the next state.

protected void Next(Action state)

Parameters

state Action

The state to advance to.

Reset()

Reset this task.

public void Reset()