Skip to content

Commit

Permalink
Fix for WSL (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
reubeno authored Mar 29, 2018
1 parent 49e964f commit 72c001f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/NClap/ConsoleInput/BasicConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ internal class BasicConsole : IConsoleInput, IConsoleOutput

private readonly PropertyWithSimulatedFallback<ConsoleColor> _foregroundColor = CreateProperty(
() => Console.ForegroundColor, value => Console.ForegroundColor = value,
_defaultForegroundColor,
color => color >= ConsoleColor.Black && color <= ConsoleColor.White);
_defaultForegroundColor);

private readonly PropertyWithSimulatedFallback<ConsoleColor> _backgroundColor = CreateProperty(
() => Console.BackgroundColor, value => Console.BackgroundColor = value,
_defaultBackgroundColor,
color => color >= ConsoleColor.Black && color <= ConsoleColor.White);
_defaultBackgroundColor);

private readonly PropertyWithSimulatedFallback<bool> _treatControlCAsInput = CreateProperty(
() => Console.TreatControlCAsInput, value => Console.TreatControlCAsInput = value,
Expand Down
4 changes: 2 additions & 2 deletions src/NClap/Utilities/PropertyWithSimulatedFallback`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public PropertyWithSimulatedFallback(
// Make sure the initial fallback value passes validation.
if (!this._fallbackValidator(initialFallbackValue))
{
throw new ArgumentOutOfRangeException(nameof(initialFallbackValue));
throw new ArgumentOutOfRangeException(nameof(initialFallbackValue), $"Tried to set value to '{initialFallbackValue}', but failed validation.");
}
}

Expand All @@ -72,7 +72,7 @@ public T Value
// First validate the incoming value.
if (!_fallbackValidator(value))
{
throw new ArgumentOutOfRangeException(nameof(value));
throw new ArgumentOutOfRangeException(nameof(value), $"Tried to set value to '{value}', but failed validation.");
}

try
Expand Down

0 comments on commit 72c001f

Please sign in to comment.