mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Merge pull request #1593 from PowerShell/ealexjordan/pscolors
Ealexjordan/pscolors
This commit is contained in:
commit
b1ea06aaef
3 files changed
+12
-26
No files matched your search
@@ -1520,16 +1520,11 @@ namespace Microsoft.PowerShell
|
||||
|
||||
internal sealed class ConsoleHostRawUserInterface : PSHostRawUserInterface
|
||||
{
|
||||
private ConsoleColor _defaultForeground = ConsoleColor.Gray;
|
||||
|
||||
private ConsoleColor _defaultBackground = ConsoleColor.Black;
|
||||
|
||||
private ConsoleHostUserInterface _parent = null;
|
||||
|
||||
internal ConsoleHostRawUserInterface(ConsoleHostUserInterface mshConsole) : base()
|
||||
{
|
||||
_defaultForeground = ForegroundColor;
|
||||
_defaultBackground = BackgroundColor;
|
||||
_parent = mshConsole;
|
||||
}
|
||||
|
||||
@@ -1539,14 +1534,7 @@ namespace Microsoft.PowerShell
|
||||
/// </summary>
|
||||
public override ConsoleColor BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
// Console can return UnknownColor, a private enum, equivalent
|
||||
// to -1. When this is a case, map it instead to our default.
|
||||
return Console.BackgroundColor == (ConsoleColor)(-1)
|
||||
? _defaultBackground
|
||||
: Console.BackgroundColor;
|
||||
}
|
||||
get { return Console.BackgroundColor; }
|
||||
set { Console.BackgroundColor = value; }
|
||||
}
|
||||
|
||||
@@ -1600,14 +1588,7 @@ namespace Microsoft.PowerShell
|
||||
/// </summary>
|
||||
public override ConsoleColor ForegroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
// Console can return UnknownColor, a private enum, equivalent
|
||||
// to -1. When this is a case, map it instead to our default.
|
||||
return Console.ForegroundColor == (ConsoleColor)(-1)
|
||||
? _defaultForeground
|
||||
: Console.ForegroundColor;
|
||||
}
|
||||
get { return Console.ForegroundColor; }
|
||||
set { Console.ForegroundColor = value; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1450,7 +1450,8 @@ namespace Microsoft.PowerShell
|
||||
set
|
||||
{ _errorForegroundColor = value; }
|
||||
}
|
||||
private ConsoleColor _errorBackgroundColor = ConsoleColor.Black;
|
||||
|
||||
private ConsoleColor _errorBackgroundColor = Console.BackgroundColor;
|
||||
public ConsoleColor ErrorBackgroundColor
|
||||
{
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
@@ -1472,7 +1473,8 @@ namespace Microsoft.PowerShell
|
||||
set
|
||||
{ _warningForegroundColor = value; }
|
||||
}
|
||||
private ConsoleColor _warningBackgroundColor = ConsoleColor.Black;
|
||||
|
||||
private ConsoleColor _warningBackgroundColor = Console.BackgroundColor;
|
||||
public ConsoleColor WarningBackgroundColor
|
||||
{
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
@@ -1494,7 +1496,8 @@ namespace Microsoft.PowerShell
|
||||
set
|
||||
{ _debugForegroundColor = value; }
|
||||
}
|
||||
private ConsoleColor _debugBackgroundColor = ConsoleColor.Black;
|
||||
|
||||
private ConsoleColor _debugBackgroundColor = Console.BackgroundColor;
|
||||
public ConsoleColor DebugBackgroundColor
|
||||
{
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
@@ -1516,7 +1519,8 @@ namespace Microsoft.PowerShell
|
||||
set
|
||||
{ _verboseForegroundColor = value; }
|
||||
}
|
||||
private ConsoleColor _verboseBackgroundColor = ConsoleColor.Black;
|
||||
|
||||
private ConsoleColor _verboseBackgroundColor = Console.BackgroundColor;
|
||||
public ConsoleColor VerboseBackgroundColor
|
||||
{
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
|
||||
Reference in new issue
Block a user