Class SwitchRole
This command executes the SwitchRole system command
Lists all roles the user has access to as child commands.
Switches the role the current user is running in, and performs a RefreshAll(IModelLayoutCommon) to run the system under that new roleInheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Commands
Assembly: ClientCore.dll
Syntax
[CommandDescriptorOptions(Commands.SwitchRole, null)]
public class SwitchRole : EPCommandWithDescriptor, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
SwitchRole(IModelLayoutCommon)
Creates a new SwitchRole command that lists all roles the user has access to as child commands.
Declaration
public SwitchRole(IModelLayoutCommon owner)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | owner | The owning context for this command |
SwitchRole(IModelLayoutCommon, IRole)
Creates a new SwitchRole command that switches the current role to the specified one and refreshes the entire system to run under that new role
Declaration
public SwitchRole(IModelLayoutCommon owner, IRole role)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | owner | The owning context for this command |
IRole | role | The new role to run the entire system under |
Properties
Description
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
HasChildCommands
True if this is the root command listing all possible roles as children
Declaration
public override bool HasChildCommands { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IconID
Declaration
public override Guid IconID { get; }
Property Value
Type | Description |
---|---|
System.Guid |
Overrides
Title
Declaration
public override string Title { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
InternalCanExecute(Object)
True if the command is running with an owner of the main application form
Declaration
public override bool InternalCanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | The command parameter |
Returns
Type | Description |
---|---|
System.Boolean | True if the command is running with an owner of the main application form |
Overrides
InternalExecuteAsync(Object)
Switches the role the current user is running in to the specified one, and performs a RefreshAll(IModelLayoutCommon) to run the system under that new role
Declaration
public override Task InternalExecuteAsync(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | The command parameter |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
LoadChildrenAsync()
Loads all the roles this user has access to run in
Declaration
public override Task LoadChildrenAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
Switch(IModelLayoutCommon, IRole)
Switches the role the current user is running in to the specified one, and performs a RefreshAll(IModelLayoutCommon) to run the system under that new role
Declaration
public static Task Switch(IModelLayoutCommon owner, IRole role)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | owner | The owning context this command runs in |
IRole | role | The new role to switch running the application under |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |