Class WorkAction
Represent a Work Action to perform something.
Inheritance
Implements
Inherited Members
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 is a root task, use the other constructor. |
Fields
IsSkippable
The skippable.
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 the canceled.
Declaration
protected virtual void PerformCancel()
PerformCompleted()
Notifies the completed.
Declaration
protected void PerformCompleted()
PerformRun()
Ons the run.
Declaration
protected abstract void PerformRun()
PerformSkip()
Notifies the skip.
Declaration
protected virtual bool PerformSkip()
Returns
Type | Description |
---|---|
bool | If the action is skipped successfully. |
Run()
Runs this instance.
Declaration
public virtual void Run()
Exceptions
Type | Condition |
---|---|
NotSupportedException | When the action state is not correct. |
TrySkip()
Skips this instance.
Declaration
public bool TrySkip()
Returns
Type | Description |
---|---|
bool | If the action is skipped successfully. |
Exceptions
Type | Condition |
---|---|
NotImplementedException | When the action state is not correct. |
Events
Canceled
Event fired when an action has been canceled.
Declaration
public event Action<IWorkAction> Canceled
Event Type
Type | Description |
---|---|
Action<IWorkAction> |
Completed
Event fired when an action is completed.
Declaration
public event Action<IWorkAction> Completed
Event Type
Type | Description |
---|---|
Action<IWorkAction> |
Skipped
Occurs when the action has been skipped.
Declaration
public event Action<IWorkAction> Skipped
Event Type
Type | Description |
---|---|
Action<IWorkAction> |