CommanderModel
ConsoleMonster.Apps.Commander
The two panels of ConsoleMonster Commander and the operations between them: switching, swapping, showing one folder in both, and planning copies, moves, deletes and new folders from the active panel's targets.
Inheritance
- object
- CommanderModel
Remarks
Planning reads the panels on the app thread and returns a FileOperation that can run anywhere.
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property CommanderContext.Model
Accepted by parameters 1
- Constructor CommanderContext.CommanderContext
Constructors
public CommanderModel(CommanderState? state = null) #Opens both panels from remembered state.
Parameters
- state ConsoleMonster.Apps.Commander.CommanderState? = null
- The state, such as CommanderState.Load returns; defaults open the home folder twice.
public CommanderModel(string left, string right) #Opens two panels on given folders.
Parameters
- left string
- The left folder.
- right string
- The right folder.
Methods
public void AfterOperation(FileOperation operation) #Lists both panels after an operation and puts the active cursor on what it created, when it's in view.
Parameters
- operation ConsoleMonster.FileSystem.FileOperation
- The finished operation.
public CommanderPanel Panel(CommanderSide side) #A panel by side.
Parameters
- side ConsoleMonster.Apps.Commander.CommanderSide
- The side.
public FileOperation? PlanCopy(FileOperationOptions? options = null, string? destination = null) #Plans copying the active panel's targets into the other panel's folder (F5).
Parameters
- options ConsoleMonster.FileSystem.FileOperationOptions? = null
- Conflict policy, timestamps and progress.
- destination string? = null
- A destination other than the other panel's folder, such as one typed into the copy dialog.
public FileOperation PlanCreateFolder(string name, FileOperationOptions? options = null) #Plans a new folder in the active panel's folder (F7).
Parameters
- name string
- The name, which may include subfolders (docs/2026).
- options ConsoleMonster.FileSystem.FileOperationOptions? = null
- Progress.
public FileOperation? PlanDelete(bool permanently = false, FileOperationOptions? options = null) #Plans deleting the active panel's targets: to the trash (F8), or permanently (Shift+F8).
Parameters
- permanently bool = false
- Whether to bypass the trash.
- options ConsoleMonster.FileSystem.FileOperationOptions? = null
- Trash and progress.
public FileOperation? PlanMove(FileOperationOptions? options = null, string? destination = null) #Plans moving the active panel's targets into the other panel's folder, or renaming one item (F6).
Parameters
- options ConsoleMonster.FileSystem.FileOperationOptions? = null
- Conflict policy, timestamps and progress.
- destination string? = null
- A destination other than the other panel's folder; a plain name renames in place.
public bool SameFolder() #Opens the active panel's folder in the other panel too.
Returns
bool Whether the other panel could open it.public void SwapPanels() #Exchanges the panels' places; focus stays with the same panel, now on the other side.
Inherited Methods
Properties
public CommanderPanel Other { get; } #The other panel: the default destination of copies and moves.