Skip to content
ConsoleMonster
Class

CommanderModel

ConsoleMonster.Apps.Commander

Namespace
ConsoleMonster.Apps.Commander
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

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

Accepted by parameters 1

Constructors

CommanderModel 2 overloads
public CommanderModel(CommanderState? state = null) #

Opens both panels from remembered state.

Parameters

state ConsoleMonster.Apps.Commander.CommanderState? = null optional
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 required
The left folder.
right string required
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 required
The finished operation.
public void Dispose() #

Stops both panels' background work.

public CommanderPanel Panel(CommanderSide side) #

A panel by side.

Parameters

side ConsoleMonster.Apps.Commander.CommanderSide required
The side.

Returns

CommanderPanel The panel.
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 optional
Conflict policy, timestamps and progress.
destination string? = null optional
A destination other than the other panel's folder, such as one typed into the copy dialog.

Returns

FileOperation? The operation, or null when nothing is selected.
public FileOperation PlanCreateFolder(string name, FileOperationOptions? options = null) #

Plans a new folder in the active panel's folder (F7).

Parameters

name string required
The name, which may include subfolders (docs/2026).
options ConsoleMonster.FileSystem.FileOperationOptions? = null optional
Progress.

Returns

FileOperation The operation.
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 optional
Whether to bypass the trash.
options ConsoleMonster.FileSystem.FileOperationOptions? = null optional
Trash and progress.

Returns

FileOperation? The operation, or null when nothing is selected.
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 optional
Conflict policy, timestamps and progress.
destination string? = null optional
A destination other than the other panel's folder; a plain name renames in place.

Returns

FileOperation? The operation, or null when nothing is selected.
public void RefreshAll() #

Lists both panels again, keeping cursors and marks.

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.

public void SwitchPanels() #

Moves focus to the other panel (Tab).

Properties

public CommanderPanel Left { get; private set; } #

The left panel.

public CommanderPanel Right { get; private set; } #

The right panel.

public CommanderSide ActiveSide { get; set; } #

Which panel has focus.

public CommanderPanel Active { get; } #

The panel with focus.

public CommanderPanel Other { get; } #

The other panel: the default destination of copies and moves.

public CommanderState State { get; } #

The state to remember on exit.