Class MainThreadCommand
Contains an action to execute on the main thread and its current status.
Implements
Inherited Members
Namespace: InsaneScatterbrain.Threading
Syntax
public class MainThreadCommand : IMainThreadCommand
Constructors
MainThreadCommand()
Declaration
public MainThreadCommand()
MainThreadCommand(Action)
Declaration
public MainThreadCommand(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action |
Properties
Done
Returns whether the command is done executing or not.
Declaration
public bool Done { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Cancel()
Stops executing the command as soon as possible.
Declaration
public void Cancel()
Execute()
Executes the command.
Declaration
public void Execute()
SetAction(Action)
Declaration
public void SetAction(Action setAction)
Parameters
Type | Name | Description |
---|---|---|
Action | setAction |
WaitForCompletion()
Makes the calling thread wait for the completion of this command.
Declaration
public void WaitForCompletion()
Exceptions
Type | Condition |
---|---|
Exception | If an exception occurred while executing the command, it will be rethrown here to the calling thread. |