Class ConsoleBufferSnapshot
- Namespace
- SharpConsoleUI.Diagnostics.Snapshots
- Assembly
- SharpConsoleUI.dll
Captures the state of the ConsoleBuffer's front and back buffers. Used to validate double-buffering and dirty cell detection.
public class ConsoleBufferSnapshot
- Inheritance
-
ConsoleBufferSnapshot
- Inherited Members
Properties
BackBuffer
Gets the back buffer (to be rendered).
public ConsoleCell[,] BackBuffer { get; init; }
Property Value
- ConsoleCell[,]
DirtyCells
Gets the list of dirty cell positions.
public List<(int x, int y)> DirtyCells { get; init; }
Property Value
FrameNumber
Gets the frame number this snapshot represents.
public int FrameNumber { get; init; }
Property Value
FrontBuffer
Gets the front buffer (currently displayed).
public ConsoleCell[,] FrontBuffer { get; init; }
Property Value
- ConsoleCell[,]
Height
Gets the height of the buffer.
public int Height { get; init; }
Property Value
Timestamp
Gets the timestamp when this snapshot was taken.
public DateTime Timestamp { get; init; }
Property Value
Width
Gets the width of the buffer.
public int Width { get; init; }
Property Value
Methods
GetBack(int, int)
Gets the back buffer cell at the specified position.
public ConsoleCell GetBack(int x, int y)
Parameters
Returns
GetDifferences()
Compares front and back buffers and returns cells that differ.
public List<(int x, int y, ConsoleCell front, ConsoleCell back)> GetDifferences()
Returns
- List<(int x, int y, ConsoleCell front, ConsoleCell back)>
GetDirtyCount()
Gets the number of dirty cells.
public int GetDirtyCount()
Returns
GetFront(int, int)
Gets the front buffer cell at the specified position.
public ConsoleCell GetFront(int x, int y)
Parameters
Returns
IsCellDirty(int, int)
Checks if a cell at the specified position is dirty.
public bool IsCellDirty(int x, int y)