ReplPagerRenderContext
Provides terminal, input, and payload state to a custom result-flow pager renderer.
- Kind:
Class - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/ResultFlow/ReplPagerRenderContext.cs
Signature
Section titled “Signature”public sealed class ReplPagerRenderContextInheritance
Section titled “Inheritance”Constructors
Section titled “Constructors”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)Parameters
Section titled “Parameters”initialPayload(string)output(TextWriter)keyReader(IReplKeyReader)visibleRows(int)visibleRowsProvider(Func<int>)ansiEnabled(bool)hasMorePayload(bool)fetchNextPayload(Func<CancellationToken, ValueTask<ReplPagerPayload>>)
Methods
Section titled “Methods”FetchNextPayloadAsync(CancellationToken)
Section titled “FetchNextPayloadAsync(CancellationToken)”Fetches the next rendered payload when the result source can continue.
public ValueTask<ReplPagerPayload?> FetchNextPayloadAsync(CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”cancellationToken(CancellationToken): Cancellation token.
Returns
Section titled “Returns”ValueTask<ReplPagerPayload> - The next payload, or null when no fetcher is available or the source ended.
Properties
Section titled “Properties”AnsiEnabled
Section titled “AnsiEnabled”Gets whether ANSI terminal control sequences can be used.
public bool AnsiEnabled { get; }Returns
Section titled “Returns”CanFetchNextPayload
Section titled “CanFetchNextPayload”Gets a value indicating whether a next payload fetcher is available.
public bool CanFetchNextPayload { get; }Returns
Section titled “Returns”HasMorePayload
Section titled “HasMorePayload”Gets whether another payload can initially be fetched.
public bool HasMorePayload { get; }Returns
Section titled “Returns”InitialPayload
Section titled “InitialPayload”Gets the first rendered payload.
public string InitialPayload { get; }Returns
Section titled “Returns”KeyReader
Section titled “KeyReader”Gets the key reader used for interactive navigation.
public IReplKeyReader KeyReader { get; }Returns
Section titled “Returns”Output
Section titled “Output”Gets the output writer controlled by the pager.
public TextWriter Output { get; }Returns
Section titled “Returns”VisibleRows
Section titled “VisibleRows”Gets the initial visible row count available to the pager.
public int VisibleRows { get; }Returns
Section titled “Returns”VisibleRowsProvider
Section titled “VisibleRowsProvider”Gets the current visible row resolver when available.
public Func<int>? VisibleRowsProvider { get; }Returns
Section titled “Returns”Func<int>