System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.3300.0 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Diagnostics.TraceListener

An instance of this class is automatically added to the and collections. Explicitly adding a second causes duplicate messages in the debugger output window and duplicate message boxes for asserts.

By default, the and methods emit the message to the Win32 OutputDebugString function and to the method. For information about the OutputDebugString function, see the Platform SDK or MSDN.

The method, by default, displays a message box when the application is running in a user interface mode; it also emits the message using .

The display of the message box for and method calls depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by the <clear> element, by the <remove> element, or by calling the method on the property (System.Diagnostics.Trace.Listeners.Clear()).

You must enable tracing or debugging to use a trace listener. The following syntax is compiler specific. If you use compilers other than C# or Visual Basic, refer to the documentation for your compiler.

To enable debugging in C#, add the /d:DEBUG flag to the compiler command line when you compile your code, or add #define DEBUG to the top of your file. In Visual Basic, add the /d:DEBUG=True flag to the compiler command line.

To enable tracing in C#, add the /d:TRACE flag to the compiler command line when you compile your code, or add #define TRACE to the top of your file. In Visual Basic, add the /d:TRACE=True flag to the compiler command line.

To add a trace listener, edit the configuration file that corresponds to the name of your application. Within this file, you can add a listener, set its type and set its parameters, remove a listener, or clear all the listeners previously set by the application. The configuration file should be formatted similar to the following example:

`<configuration> <system.diagnostics> <trace autoflush="false" indentsize="4"> <listeners> <remove name="Default" /> <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\myListener.log" /> </listeners> </trace> </system.diagnostics> </configuration>`

Provides the default output methods and behavior for tracing.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  Constructs a new instance of the class, with a value of Default.

  Initializes a new instance of the class with "Default" as its property value.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean Whether or not a GUI should be used when is called.

  If , calls to should appear in a GUI dialog box.

  This is currently ignored by Mono.

  Gets or sets a value indicating whether the application is running in user-interface mode.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  By default, this method sends the parameter and a stack trace to a message box (when the application runs in user-interface mode) and to the instance.

  Emits or displays a message and a stack trace for an assertion that always fails.

  The message to emit or display.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  By default, this method sends the parameter, the parameter, and a stack trace to a message box (when the application runs in user-interface mode) and to the instance.

  Emits or displays detailed messages and a stack trace for an assertion that always fails.

  The message to emit or display. The detailed message to emit or display.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.MonoTODO
  System.String To be added: an object of type 'string' When set to a non-empty string, all debug and trace messages are appended to the specified file.

  Gets or sets the name of a log file to write trace or debug messages to.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  For information about the Win32 OutputDebugString debugging function, see "OutputDebugString" in the Platform SDK or MSDN.

  Writes the output to the OutputDebugString function and to the method.

  The message to write to OutputDebugString and .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The default line terminator is a carriage return followed by a line feed (\r\n).

  For information about the Win32 OutputDebugString debugging function, see the Platform SDK or MSDN.

  This method sets the property to true.

  Writes the output to the OutputDebugString function and to the method, followed by a carriage return and line feed (\r\n).

  The message to write to OutputDebugString and .