Gets or sets the indent level.
[Visual Basic] Public Shared Property IndentLevel As Integer [C#] public static int IndentLevel {get; set;} [C++] public: __property static int get_IndentLevel(); public: __property static void set_IndentLevel(int); [JScript] public static function get IndentLevel() : int; public static function set IndentLevel(int);
The indent level. The default is 0.
Debug stores this property on a per-thread/per-request basis.
The following example sets the indent level and emits debugging messages.
[Visual Basic] Debug.WriteLine("List of errors:") Debug.Indent() Debug.WriteLine("Error 1: File not found") Debug.WriteLine("Error 2: Directory not found") Debug.Unindent() Debug.WriteLine("End of list of errors") [C#] Debug.WriteLine("List of errors:"); Debug.Indent(); Debug.WriteLine("Error 1: File not found"); Debug.WriteLine("Error 2: Directory not found"); Debug.Unindent(); Debug.WriteLine("End of list of errors"); [C++] Debug::WriteLine(S"List of errors:"); Debug::Indent(); Debug::WriteLine(S"Error 1: File not found"); Debug::WriteLine(S"Error 2: Directory not found"); Debug::Unindent(); Debug::WriteLine(S"End of list of errors"); [JScript] Debug.WriteLine("List of errors:"); Debug.Indent(); Debug.WriteLine("Error 1: File not found"); Debug.WriteLine("Error 2: Directory not found"); Debug.Unindent(); Debug.WriteLine("End of list of errors");
This example produces the following output:
List of errors
Error 1: File not found
Error 2: Directory not found
End of list of errors
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Debug Class | Debug Members | System.Diagnostics Namespace | IndentSize | Debug | Trace | BooleanSwitch | TraceSwitch | TraceListener | DefaultTraceListener | ConditionalAttribute