mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-11 02:35:05 +00:00
fix: Fixed a bug where color formatted console output on Net Standard was not raising the OnConsolePrint event
This commit is contained in:
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Changed
|
||||
- Fixed exception trying to get DHCP status of network interfaces on Linux
|
||||
- Fixed a bug where color formatted console output on Net Standard was not raising the OnConsolePrint event
|
||||
|
||||
## [10.3.0] - 2020-01-20
|
||||
### Changed
|
||||
|
||||
@@ -83,13 +83,17 @@ namespace ICD.Common.Utils
|
||||
|
||||
public static void PrintLine(eConsoleColor color, string message)
|
||||
{
|
||||
string ansi = color.FormatAnsi(message);
|
||||
|
||||
#if SIMPLSHARP
|
||||
PrintLine(color.FormatAnsi(message));
|
||||
PrintLine(ansi);
|
||||
#else
|
||||
System.Console.ForegroundColor = color.ToForegroundConsoleColor();
|
||||
System.Console.BackgroundColor = color.ToBackgroundConsoleColor();
|
||||
System.Console.WriteLine(message);
|
||||
System.Console.ResetColor();
|
||||
|
||||
OnConsolePrint.Raise(null, new StringEventArgs(ansi + IcdEnvironment.NewLine));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -118,6 +122,8 @@ namespace ICD.Common.Utils
|
||||
|
||||
public static void Print(eConsoleColor color, string message)
|
||||
{
|
||||
string ansi = color.FormatAnsi(message);
|
||||
|
||||
#if SIMPLSHARP
|
||||
Print(color.FormatAnsi(message));
|
||||
#else
|
||||
@@ -125,6 +131,8 @@ namespace ICD.Common.Utils
|
||||
System.Console.BackgroundColor = color.ToBackgroundConsoleColor();
|
||||
System.Console.Write(message);
|
||||
System.Console.ResetColor();
|
||||
|
||||
OnConsolePrint.Raise(null, new StringEventArgs(ansi));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user