AppCommand
ConsoleMonster.Interactive
One passive action definition shared by buttons, palettes and grid actions.
Inheritance
- object
- AppCommand
Usage
Explore 15 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 8
- Extension method AppCommand.WithConfirmPrompt
- Extension method AppCommand.WithShortcut
- Method AppCommandFluent.WithConfirmPrompt
- Method AppCommandFluent.WithShortcut
- Property Button.Command
- Property ConsoleAppOptions.Commands
- Property GridOptions.Commands
- Property GridOptions.RefreshRow
Accepted by parameters 7
- Extension method AppCommand.WithConfirmPrompt
- Extension method AppCommand.WithShortcut
- Method AppCommandFluent.WithConfirmPrompt
- Method AppCommandFluent.WithShortcut
- Constructor Button.Button
- Extension method Button.WithCommand
- Method ButtonFluent.WithCommand
Constructors
public AppCommand(string key, string label, Func<AppActionContext, CancellationToken, Task> action) #Creates an asynchronous action. The callback runs outside the app thread and must use its context to report output.
Parameters
- key string
- label string
- action System.Func<ConsoleMonster.Interactive.AppActionContext, System.Threading.CancellationToken, System.Threading.Tasks.Task>
Inherited Methods
Properties
public string Key { get; } #Stable command identity, independent of the selected data row.
public KeyChord? Shortcut { get; set; } #Optional keyboard shortcut. Text editing retains precedence over plain character shortcuts.
public string? ConfirmPrompt { get; set; } #Optional modal confirmation text. {Selection} expands to the captured row label or row count. Its default answer is No.
public Func<AppActionContext, CancellationToken, Task> Action { get; } #The operation, which receives captured rows and cooperative cancellation.
Extension Methods
public static AppCommand WithConfirmPrompt(AppCommand appCommand, string? value) #Sets AppCommand.ConfirmPrompt: Optional modal confirmation text. {Selection} expands to the captured row label or row count. Its default answer is No.
Parameters
- appCommand ConsoleMonster.Interactive.AppCommand
- The instance.
- value string?
- The value.
public static AppCommand WithShortcut(AppCommand appCommand, KeyChord? value) #Sets AppCommand.Shortcut: Optional keyboard shortcut. Text editing retains precedence over plain character shortcuts.
Parameters
- appCommand ConsoleMonster.Interactive.AppCommand
- The instance.
- value ConsoleMonster.Input.KeyChord?
- The value.