Class SwitchSafe
This command executes the SwitchSafe system command
Lists all safes the user has access to, and the main system (no safe), as child commands.
Executing any will switch the users context to that safe, or main system. Any new item created by the user will automatically belong to that safe.Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Commands
Assembly: LemonEdge.ClientCore.dll
Syntax
[CommandDescriptorOptions(Command.SwitchSafe, null)]
public class SwitchSafe : EPCommandWithDescriptor, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
SwitchSafe(IRootController, IModelLayoutCommon)
Creates a new SwitchSafe command which will have all safes, and the main system, as child commands
Declaration
public SwitchSafe(IRootController root, IModelLayoutCommon owner)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
IModelLayoutCommon | owner | The owning context for this command |
SwitchSafe(IRootController, IModelLayoutCommon, ISafe)
Creates a new SwitchSafe that will switch the system into running under the specified safe
Declaration
protected SwitchSafe(IRootController root, IModelLayoutCommon owner, ISafe safe)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
IModelLayoutCommon | owner | The owning context for this command |
ISafe | safe | The safe the system will switch to running under |
SwitchSafe(IRootController, IModelLayoutCommon, bool)
Creates a new SwitchSafe command which will switch the system into the main system - no safe
Declaration
protected SwitchSafe(IRootController root, IModelLayoutCommon owner, bool reset)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
IModelLayoutCommon | owner | The owning context for this command |
bool | reset | Indicates to switch into the main system |
Properties
Description
A user friendly description of this command
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
HasChildCommands
True if this is the root command that lists all accessible safes and the main system
Declaration
public override bool HasChildCommands { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
IconID
Declaration
public override Guid IconID { get; }
Property Value
Type | Description |
---|---|
Guid |
Overrides
Title
The title of this command
Declaration
public override string Title { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
InternalCanExecute(object)
True if the owning host is the main form application instance
Declaration
public override bool InternalCanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
bool | True if the owning host is the main form application instance |
Overrides
InternalExecuteAsync(object)
Switches running the system into the specified safe, or main system (no safe), for this command
Declaration
public override Task InternalExecuteAsync(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of this operation |
Overrides
LoadChildrenAsync()
Loads all the safes this user has access to run in, along with the main system
Declaration
public override Task LoadChildrenAsync()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
Switch(IModelLayoutCommon, ISafe, bool)
Switch the users context to the specified safe, or main system
Declaration
public static Task Switch(IModelLayoutCommon owner, ISafe safe, bool reset)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | owner | The owning host this command runs within |
ISafe | safe | The safe to switch running the system into. Can be null if switching to the main system. |
bool | reset | If true then will switch the system into running under the main system - no safe |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |