Class ConsoleResizeHandler
The console resize listener module
Inheritance
object
ConsoleResizeHandler
Namespace: Terminaux.Base
Assembly: Terminaux.dll
Syntax
public static class ConsoleResizeHandler
Properties
| Edit this page View SourceIsListening
Whether the console resize handler is listening to resize events or not
Declaration
public static bool IsListening { get; }
Property Value
Type | Description |
---|---|
bool |
RunEssentialHandler
Whether to run the base console resize handler or not after running a custom action
Declaration
public static bool RunEssentialHandler { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceGetCurrentConsoleSize()
Gets the console size from the cached window height and width position
Declaration
public static (int Width, int Height) GetCurrentConsoleSize()
Returns
Type | Description |
---|---|
(int Width, int Height) |
StartResizeListener(Action<int, int, int, int>?)
Starts the console resize listener
Declaration
public static void StartResizeListener(Action<int, int, int, int>? customHandler = null)
Parameters
Type | Name | Description |
---|---|---|
Action<int, int, int, int> | customHandler | Specifies the custom console resize handler that will be called if resize is detected |
StopResizeListener()
Stops the console resize listener
Declaration
public static void StopResizeListener()
WasResized(bool)
This property checks to see if the console has been resized since the last time it has been called or the listener has started.
Declaration
public static bool WasResized(bool reset = true)
Parameters
Type | Name | Description |
---|---|---|
bool | reset | Reset the resized value once this is called |
Returns
Type | Description |
---|---|
bool |