Skip to content

ReplPagerRenderContext

Provides terminal, input, and payload state to a custom result-flow pager renderer.

public sealed class ReplPagerRenderContext

ReplPagerRenderContext(string, TextWriter, IReplKeyReader, int, Func<int>?, bool, bool, Func<CancellationToken, ValueTask<ReplPagerPayload?>>?)

Section titled “ReplPagerRenderContext(string, TextWriter, IReplKeyReader, int, Func<int>?, bool, bool, Func<CancellationToken, ValueTask<ReplPagerPayload?>>?)”

Initializes a new instance of the ReplPagerRenderContext class.

public ReplPagerRenderContext(string initialPayload, TextWriter output, IReplKeyReader keyReader, int visibleRows, Func<int>? visibleRowsProvider, bool ansiEnabled, bool hasMorePayload, Func<CancellationToken, ValueTask<ReplPagerPayload?>>? fetchNextPayload)
  • initialPayload (string)
  • output (TextWriter)
  • keyReader (IReplKeyReader)
  • visibleRows (int)
  • visibleRowsProvider (Func<int>)
  • ansiEnabled (bool)
  • hasMorePayload (bool)
  • fetchNextPayload (Func<CancellationToken, ValueTask<ReplPagerPayload>>)

Fetches the next rendered payload when the result source can continue.

public ValueTask<ReplPagerPayload?> FetchNextPayloadAsync(CancellationToken cancellationToken = default)

ValueTask<ReplPagerPayload> - The next payload, or null when no fetcher is available or the source ended.

Gets whether ANSI terminal control sequences can be used.

public bool AnsiEnabled { get; }

bool

Gets a value indicating whether a next payload fetcher is available.

public bool CanFetchNextPayload { get; }

bool

Gets whether another payload can initially be fetched.

public bool HasMorePayload { get; }

bool

Gets the first rendered payload.

public string InitialPayload { get; }

string

Gets the key reader used for interactive navigation.

public IReplKeyReader KeyReader { get; }

IReplKeyReader

Gets the output writer controlled by the pager.

public TextWriter Output { get; }

TextWriter

Gets the initial visible row count available to the pager.

public int VisibleRows { get; }

int

Gets the current visible row resolver when available.

public Func<int>? VisibleRowsProvider { get; }

Func<int>