Skip to content
ConsoleMonster
Class

GridOptions

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

Options for Grid.Show.

Inheritance

  • object
  • GridOptions

Usage

Explore 39 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.

Accepted by parameters 21

Constructors

public GridOptions() #

Properties

public IList<AppCommand> Command { get; } #

Commands available through the action palette and their shortcuts. Actions keep the grid open.

public Func<AppCommand, GridRow, GridRow>? RefreshRow { get; set; } #
Fluent("RefreshRowBy")

Refreshes each acted-on row on the input thread after successful completion. Return a new snapshot in the same column order; selection and row position are retained. Keep this callback short.

public AppDispatcher? Dispatcher { get; set; } #

Optional per-run mailbox, drained on the input thread and closed when the grid exits.

public InteractiveOptions? Interactive { get; set; } #

Prompt options (input, capture, theme, labels); null for the defaults.

public string? Filter { get; set; } #

The filter to start with.

public int SortColumn { get; set; } #

The column to sort by at the start (by index), or -1 for the input order.

public bool SortDescending { get; set; } #

Sorts descending at the start.

public IList<string> HiddenColumns { get; } #

Columns hidden at the start (by header).

Extension Methods

Command 2 overloads
public static GridOptions Command(GridOptions gridOptions, AppCommand item) #

Adds an item to GridOptions.Command: Commands available through the action palette and their shortcuts. Actions keep the grid open.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
item ConsoleMonster.Interactive.AppCommand required
The item.

Returns

GridOptions The same instance.
public static GridOptions Command(GridOptions gridOptions, IEnumerable<AppCommand> items) #

Adds items to GridOptions.Command: Commands available through the action palette and their shortcuts. Actions keep the grid open.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.AppCommand> required
The items, in order.

Returns

GridOptions The same instance.
public static GridOptions Dispatcher(GridOptions gridOptions, AppDispatcher? value) #

Sets GridOptions.Dispatcher: Optional per-run mailbox, drained on the input thread and closed when the grid exits.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value ConsoleMonster.Interactive.AppDispatcher? required
The value.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { Dispatcher = value };    gridOptions.Dispatcher(value);
public static GridOptions Filter(GridOptions gridOptions, string? value) #

Sets GridOptions.Filter: The filter to start with.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value string? required
The value.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { Filter = value };    gridOptions.Filter(value);
public static GridOptions HiddenColumn(GridOptions gridOptions, string item) #

Adds an item to GridOptions.HiddenColumns: Columns hidden at the start (by header).

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
item string required
The item.

Returns

GridOptions The same instance.
public static GridOptions HiddenColumns(GridOptions gridOptions, IEnumerable<string> items) #

Adds items to GridOptions.HiddenColumns: Columns hidden at the start (by header).

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

GridOptions The same instance.
Interactive 2 overloads
public static GridOptions Interactive(GridOptions gridOptions, InteractiveOptions? value) #

Sets GridOptions.Interactive: Prompt options (input, capture, theme, labels); null for the defaults.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value ConsoleMonster.Interactive.InteractiveOptions? required
The value.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { Interactive = value };    gridOptions.Interactive(value);
public static GridOptions Interactive(GridOptions gridOptions, Action<InteractiveOptions> configure) #

Configures GridOptions.Interactive in place (creating it when not set): Prompt options (input, capture, theme, labels); null for the defaults.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
configure System.Action<ConsoleMonster.Interactive.InteractiveOptions> required
Configures the value.

Returns

GridOptions The same instance.
public static GridOptions RefreshRowBy(GridOptions gridOptions, Func<AppCommand, GridRow, GridRow>? value) #

Sets GridOptions.RefreshRow: Refreshes each acted-on row on the input thread after successful completion. Return a new snapshot in the same column order; selection and row position are retained. Keep this callback short.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value System.Func<ConsoleMonster.Interactive.AppCommand, ConsoleMonster.Interactive.GridRow, ConsoleMonster.Interactive.GridRow>? required
The callback.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { RefreshRow = value };    gridOptions.RefreshRowBy(value);
public static GridOptions SortColumn(GridOptions gridOptions, int value) #

Sets GridOptions.SortColumn: The column to sort by at the start (by index), or -1 for the input order.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value int required
The value.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { SortColumn = value };    gridOptions.SortColumn(value);
public static GridOptions SortDescending(GridOptions gridOptions, bool value = true) #

Sets GridOptions.SortDescending: Sorts descending at the start.

Parameters

gridOptions ConsoleMonster.Interactive.GridOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

GridOptions The same instance.

Examples

// C# initializer or property                                                     // C# fluent
new global::ConsoleMonster.Interactive.GridOptions { SortDescending = value };    gridOptions.SortDescending(value);