/// Initializes a new instance of the <see cref="WindowTraceListener" /> class.
/// </summary>
/// <param name="window">The window.</param>
publicWindowTraceListener(LogWindowwindow)
{
_window=window;
_window.Show();
Name="MBLogWindow";
}
/// <summary>
/// Writes the value of the object's <see cref="M:System.Object.ToString" /> method to the listener you create when you implement the <see cref="T:System.Diagnostics.TraceListener" /> class.
/// </summary>
/// <param name="o">An <see cref="T:System.Object" /> whose fully qualified class name you want to write.</param>
publicoverridevoidWrite(objecto)
{
varstr=oasstring;
if(str!=null)
Write(str);
else
base.Write(o);
}
/// <summary>
/// Writes the output to the OutputDebugString function and to the <see cref="M:System.Diagnostics.Debugger.Log(System.Int32,System.String,System.String)" /> method.
/// </summary>
/// <param name="message">The message to write to OutputDebugString and <see cref="M:System.Diagnostics.Debugger.Log(System.Int32,System.String,System.String)" />.</param>
/// Writes the output to the OutputDebugString function and to the <see cref="M:System.Diagnostics.Debugger.Log(System.Int32,System.String,System.String)" /> method, followed by a carriage return and line feed (\r\n).
/// </summary>
/// <param name="message">The message to write to OutputDebugString and <see cref="M:System.Diagnostics.Debugger.Log(System.Int32,System.String,System.String)" />.</param>