Class ConsoleResizeHandler
The console resize listener module
Inheritance
object
ConsoleResizeHandler
Namespace
Syntax
public static class ConsoleResizeHandler
Properties
IsListening
Whether the console resize handler is listening to resize events or not
Property Value
bool
Declaration
public static bool IsListening { get; }
RunEssentialHandler
Whether to run the base console resize handler or not after running a custom action
Property Value
bool
Declaration
public static bool RunEssentialHandler { get; set; }
Methods
GetCurrentConsoleSize()
Gets the console size from the cached window height and width position
Returns
(int Width, int Height)
Declaration
public static (int Width, int Height) GetCurrentConsoleSize()
StartResizeListener(Action<int, int, int, int>?)
Starts the console resize listener
Declaration
public static void StartResizeListener(Action<int, int, int, int>? customHandler = null)
Parameters
| Name | Type | Description |
|---|---|---|
| customHandler | Action<int, int, int, int> | 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.
Returns
bool
Declaration
public static bool WasResized(bool reset = true)
Parameters
| Name | Type | Description |
|---|---|---|
| reset | bool | Reset the resized value once this is called |