Fixed exception while the Sample Browser is shutting down.
This commit is contained in:
parent
2fd79b720e
commit
7244b80332
1 changed files with 10 additions and 5 deletions
|
@ -19,20 +19,25 @@ namespace Examples
|
|||
|
||||
public override void Write(string message)
|
||||
{
|
||||
_target.Invoke(_invokeWrite, new object[] { message });
|
||||
if (_target.Created)
|
||||
_target.Invoke(_invokeWrite, new object[] { message });
|
||||
}
|
||||
|
||||
public override void WriteLine(string message)
|
||||
{
|
||||
_target.Invoke(_invokeWrite, new object[] { message + Environment.NewLine });
|
||||
if (_target.Created)
|
||||
_target.Invoke(_invokeWrite, new object[] { message + Environment.NewLine });
|
||||
}
|
||||
|
||||
private delegate void StringSendDelegate(string message);
|
||||
private void SendString(string message)
|
||||
{
|
||||
// No need to lock text box as this function will only
|
||||
// ever be executed from the UI thread
|
||||
_target.Text += message;
|
||||
if (_target.Created)
|
||||
{
|
||||
// No need to lock text box as this function will only
|
||||
// ever be executed from the UI thread
|
||||
_target.Text += message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue