This class supplies static methods and properties to
provide tracing ability. The calls to the
methods and properties are only
executed if tracing is enabled. (See the introduction to this
chapter for instructions on enabling tracing.)
The static properties allow you to adjust the settings that are
used when you call the methods. You can specify that output be
indented a certain amount with
increase or decrease the
IndentLevel by one using
can also adjust the number of spaces each indent level adds using
sure that after each use of a
Trace method, the
Listeners are flushed.
simply write to each
TraceListener in the
Listeners collection (by default, this
collection includes an instance of
do the same, but only if the specified condition evaluates to
Assert() emits an
error message if a condition evaluates to
Fail() always emits an error message.
One possible point of confusion is that
Listeners is read-only. This means that you may
Listeners to a different collection.
You can, however, add new
TraceListenerCollection with the
You can use the application configuration file to configure this
class. Under the
<trace> element. You can set attributes for this element that correspond to ...