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.MarshalByRefObject System.IDisposable

For examples of how to implement a , see the , and the classes.

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 you can 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 parameter, 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> <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="TextWriterOutput.log" /> <remove name="Default" /> </listeners> </trace> </system.diagnostics> </configuration>`

For more information on using configuration files for tracing, see <system.diagnostics> Element.

Provides the abstract base class for the listeners who monitor trace and debug output.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The following table shows initial property values for an instance of .

  Property

  Default Value

  Name

  The empty string ("").

  Indent

  Zero.

  IndentSize

  Four spaces.

  Initializes a new instance of the class.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class using the specified name as the listener.

  The name of the .
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Specialized.StringDictionary To be added.

  Classes that inherit from the class can add custom attributes by overriding the method and returning a string array of custom attribute names. The property identifies the custom attributes that are referenced in the application's configuration file. For example, in the following configuration file excerpt the custom attribute "delimiter" is referenced. In this case, the property returns a containing the string "delimiter".

  `<listeners> <add name="delimitedListener" type="System.Diagnostics.DelimitedListTraceListener" delimiter=":" initializeData="delimitedOutput.txt" traceOutputOptions="ProcessId, DateTime" /> <remove name="Default" /> </listeners>`

  Unreferenced custom attributes are not enumerated. For more information, see the method.

  Gets the custom trace listener attributes defined in the application configuration file.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  Use this method when the output is going to a file, such as to the . After a call to this method, you must reinitialize the object.

  When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  Calling allows the resources used by the to be reallocated for other purposes. For more information about , see [<topic://cpconCleaningUpUnmanagedResources>].

  Releases all resources used by the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method is called by the public method and the method. Dispose invokes the protected method with the parameter set to true. invokes Dispose with set to false.

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose method of each referenced object.

  Releases the unmanaged resources used by the and optionally releases the managed resources.

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The default behavior is to display the specified message in a message box when the application is running in a user-interface mode, and to the instances in a collection. By default, the collection has an instance of a . You can customize this behavior by adding a to or removing one from the collection.

  Emits an error message to the listener you create when you implement the class.

  A message to emit.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The default behavior is to display the message and detailed message in a message box when the application is running in a user-interface mode, and to the instances in a collection. By default, the collection has an instance of a . You can customize this behavior by adding a to or removing one from the collection.

  Emits an error message and a detailed error message to the listener you create when you implement the class.

  A message to emit. A detailed message to emit.
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Diagnostics.TraceFilter To be added.

  A trace filter can be added to a trace listener to provide a layer of screening beyond that provided to the trace source by switches. For example, the can be added to a trace listener to control the event types that are output by the listener. Listeners that are called because the switch criteria are met can query their filter, if present, to determine if a trace is to be sent to output.

  Gets and sets the trace filter for the trace listener.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void To be added

  When overridden in a derived class, flushes the output buffer.

- Method
  2.0.0.0
  4.0.0.0
  System.String[]

  The default implementation for returns null.

  Gets the custom attributes supported by the trace listener.

  A string array naming the custom attributes supported by the trace listener, or null if there are no custom attributes.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added: an object of type 'int'

  The property represents the number of times that the indent specified by the property is applied. This property is stored on per-thread/per-request basis.

  Gets or sets the indent level.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added: an object of type 'int'

  The property is stored on per-thread/per-request basis.

  Gets or sets the number of spaces in an indent.

- Property
  2.0.0.0
  4.0.0.0
  System.MonoLimitation("This property exists but is never considered.")
  System.Boolean To be added.

  The value of is used to determine whether to use a global lock when writing to the listener. If the value of is false, the global lock is used regardless of the value of . The global lock is not used only if the value of is true and the value of is false. The default behavior is to use the global lock whenever writing to the listener.

  Gets a value indicating whether the trace listener is thread safe.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  The name can be used to organize and access listeners in a collection.

  Gets or sets a name for this .

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  Note The method, called by the and classes, sets the property value to false to prevent later, unnecessary indents. You must set the property to true each time you wish to indent trace output.

  Gets or sets a value indicating whether to indent the output.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` `` ``

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The default implementation writes the , , and parameters in the header and footer of the trace. The parameter is written as the body of the trace message. The ToString method of the data object is used to convert the object to a .

  Writes trace information, a data object and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. One of the values specifying the type of event that has caused the trace. A numeric identifier for the event. The trace data to emit.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` `` `System.ParamArray`

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The default implementation writes the values of the , and parameters as a header. The data objects are converted to strings using the ToString method of each object. The data is written as a footer, the nature of the output data being dependent on the value of the property.

  Writes trace information, an array of data objects and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. One of the values specifying the type of event that has caused the trace. A numeric identifier for the event. An array of objects to emit as data.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` ``

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The default implementation writes the values of the , and parameters as a header. The data is written as a footer, the nature of the output data being dependent on the value of the property.

  Writes trace and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. One of the values specifying the type of event that has caused the trace. A numeric identifier for the event.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` `` ``

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The default implementation writes the values of the , and parameters as a header, followed by the data. The data is written as a footer, the nature of the output data being dependent on the value of the property.

  Writes trace information, a message, and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. One of the values specifying the type of event that has caused the trace. A numeric identifier for the event. A message to write.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` `` `` `System.ParamArray`

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The default implementation writes the values of the , and parameters as a header. The object array is converted to a string using the method, passing the string and array to format the string as the message portion of the trace. The data is written as a footer, the nature of the output data being dependent on the value of the property.

  Writes trace information, a formatted array of objects and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. One of the values specifying the type of event that has caused the trace. A numeric identifier for the event. A format string that contains zero or more format items, which correspond to objects in the array. An object array containing zero or more objects to format.
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Diagnostics.TraceOptions To be added.

  The property determines the optional content of trace output. The property can be set in the configuration file or programmatically during execution to include additional data specifically for a section of code. For example, you can set the property for the console trace listener to to add call stack information to the trace output.

  The enumeration is not used by the following classes and methods:

  The class, because it can cause a large volume of data to be written to the log.

  The Write and WriteLine methods of the , , and classes.

  The and methods of the class when they are not overridden in a derived class.

  Gets or sets the trace output options.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` `` `` `` ``

  This method is not intended to be called directly by application code but by members of the , , and classes to write trace data to output.

  The method is used for the correlation of related traces. The method calls the method to process the call, with the eventType level set to and the as a string appended to the message.

  Writes trace information, a message, a related activity identity and event information to the listener specific output.

  A object that contains the current process ID, thread ID, and stack trace information. A name used to identify the output, typically the name of the application that generated the trace event. A numeric identifier for the event. A message to write. A object identifying a related activity.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` To be added

  Writes the value of the object's method to the listener you create when you implement the class.

  An whose fully qualified class name you want to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` To be added

  When overridden in a derived class, writes the specified message to the listener you create in the derived class.

  A message to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added

  Writes a category name and the value of the object's method to the listener you create when you implement the class.

  An whose fully qualified class name you want to write. A category name used to organize the output.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added

  Writes a category name and a message to the listener you create when you implement the class.

  A message to write. A category name used to organize the output.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  This method writes the indent and resets the property to false. Call this method if is true when you are overriding the and methods. By default, this method uses blank spaces for indentation. The size of the indent is determined by the values of the and properties. The property represents the number of times the indent of the size specified by the property is applied. This method is called by the and classes.

  Writes the indent to the listener you create when you implement this class, and resets the property to false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).

  Writes the value of the object's method to the listener you create when you implement the class, followed by a line terminator.

  An whose fully qualified class name you want to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).

  When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator.

  A message to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).

  Writes a category name and the value of the object's method to the listener you create when you implement the class, followed by a line terminator.

  An whose fully qualified class name you want to write. A category name used to organize the output.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).

  Writes a category name and a message to the listener you create when you implement the class, followed by a line terminator.

  A message to write. A category name used to organize the output.