for RuBoard |
The useful methods and properties are static. The overloaded WriteLine and Write are used to write debug or trace output. The overloaded WriteLineIf and WriteIf write output if the condition in their first argument is true.
Debug.WriteLine("This was compiled with a DEBUG directive!"); Trace.WriteLine("This was compiled with a TRACE directive!"); ... Debug.WriteLineIf(DebugBooleanSwitch.Enabled, "Debug Boolean Switch enabled at startup."); Debug.WriteLineIf(!DebugBooleanSwitch.Enabled, "Debug Boolean Switch disabled at startup.");
Output is indented with the Indent and Unindent methods . The indentation size is controlled with the IndentSize property.
Trace.Indent(); ... Trace.IndentSize = 10;
You can also set the indentation size in the application configuration file.
<?xml version="1.0"?> <configuration> <system.diagnostics> <trace indentsize="15" /> </system.diagnostics> </configuration>
The Assert method can check an assertion. The AutoFlush property and the Flush method control the flushing of the output buffer.
for RuBoard |