Class WorkAction
Represents a Work Action to perform something.
Inheritance
Implements
Namespace: Evergine.Components.WorkActions
Assembly: Evergine.Components.dll
Syntax
public abstract class WorkAction : IWorkAction
Constructors
WorkAction(Scene)
Initializes a new instance of the WorkAction class.
Declaration
protected WorkAction(Scene scene = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Scene | scene | The scene. |
WorkAction(IWorkAction)
Initializes a new instance of the WorkAction class.
Declaration
protected WorkAction(IWorkAction parent)
Parameters
| Type | Name | Description |
|---|---|---|
| IWorkAction | parent | The parent. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Parent task cannot be null. If it is a root task, use the other constructor. |
Fields
IsSkippable
The skippable object.
Declaration
public bool IsSkippable
Field Value
| Type | Description |
|---|---|
| bool |
Properties
ChildActions
Gets the child tasks.
Declaration
public virtual IEnumerable<IWorkAction> ChildActions { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IWorkAction> | The child tasks. |
Scene
Gets the scene.
Declaration
public Scene Scene { get; }
Property Value
| Type | Description |
|---|---|
| Scene | The scene. |
State
Gets the action state.
Declaration
public WorkActionState State { get; }
Property Value
| Type | Description |
|---|---|
| WorkActionState |
Methods
Cancel()
Cancels this instance.
Declaration
public void Cancel()
PerformCancel()
Notifies that the operation was canceled.
Declaration
protected virtual void PerformCancel()
PerformCompleted()
Notifies when completed.
Declaration
protected void PerformCompleted()
PerformRun()
On the run.
Declaration
protected abstract void PerformRun()
PerformSkip()
Notifies the skip.
Declaration
protected virtual bool PerformSkip()
Returns
| Type | Description |
|---|---|
| bool | Whether the action is skipped successfully. |
Run()
Runs this instance.
Declaration
public virtual void Run()
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The action state is not correct. |
TrySkip()
Skips this instance.
Declaration
public bool TrySkip()
Returns
| Type | Description |
|---|---|
| bool | If the action skips successfully. |
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | When the action state is not correct. |
Events
Canceled
Event fired when an action has been cancelled.
Declaration
public event Action<IWorkAction> Canceled
Event Type
| Type | Description |
|---|---|
| Action<IWorkAction> |
Completed
Event fired when an action is complete.
Declaration
public event Action<IWorkAction> Completed
Event Type
| Type | Description |
|---|---|
| Action<IWorkAction> |
Skipped
Occurs when the action is skipped.
Declaration
public event Action<IWorkAction> Skipped
Event Type
| Type | Description |
|---|---|
| Action<IWorkAction> |