diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-14 10:54:24 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-14 10:54:24 +0300 |
| commit | 9c2939ac72bdb7501ce19236c60ab5f584247fb4 (patch) | |
| tree | f06fdd57627fa79ad4df70b609ec19835289b8b7 /Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs | |
| parent | 9493a730360fbcf5afb612bcd7b3bcbe0a2174f9 (diff) | |
| download | Tango-9c2939ac72bdb7501ce19236c60ab5f584247fb4.tar.gz Tango-9c2939ac72bdb7501ce19236c60ab5f584247fb4.zip | |
Improved logging library threading model.
Diffstat (limited to 'Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs b/Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs index e95284cf8..04e5ab2fa 100644 --- a/Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs +++ b/Software/Visual_Studio/Tango.Logging/ConsoleWindow.xaml.cs @@ -24,6 +24,7 @@ namespace Tango.Logging { private bool _closing; private SolidColorBrush _currentBrush; + private ConsoleColor _current_color; /// <summary> /// Initializes a new instance of the <see cref="ConsoleWindow"/> class. @@ -75,7 +76,11 @@ namespace Tango.Logging /// <param name="color">The color.</param> public void SetColor(ConsoleColor color) { - InvokeUI(() => _currentBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(color.ToString()))); + if (_current_color != color) + { + _current_color = color; + InvokeUI(() => _currentBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(color.ToString()))); + } } private void AppendLog(String log) |
