mirror of
https://github.com/digital-jellyfish/Virtu.git
synced 2024-06-06 08:29:29 +00:00
d22639c563
Fixed code analysis warnings. --HG-- extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4047095
35 lines
848 B
C#
35 lines
848 B
C#
using System;
|
|
|
|
namespace Jellyfish.Virtu.Services
|
|
{
|
|
public sealed class WpfDebugService : DebugService
|
|
{
|
|
public WpfDebugService(Machine machine, MainWindow window) :
|
|
base(machine)
|
|
{
|
|
if (window == null)
|
|
{
|
|
throw new ArgumentNullException("window");
|
|
}
|
|
|
|
_window = window;
|
|
}
|
|
|
|
public override void WriteLine(string message)
|
|
{
|
|
message = string.Concat(DateTime.Now, " ", message, Environment.NewLine);
|
|
|
|
if (_window.CheckAccess())
|
|
{
|
|
_window._debug.Text += message;
|
|
}
|
|
else
|
|
{
|
|
_window.Dispatcher.BeginInvoke(new Action(() => _window._debug.Text += message));
|
|
}
|
|
}
|
|
|
|
private MainWindow _window;
|
|
}
|
|
}
|