Jazyk

Trace.Unindent Metoda

Definice

Zmenší aktuální IndentLevel o jeden.

public:
 static void Unindent();
[System.Diagnostics.Conditional("TRACE")]
public static void Unindent();
[<System.Diagnostics.Conditional("TRACE")>]
static member Unindent : unit -> unit
Public Shared Sub Unindent ()
Atributy

Příklady

Následující příklad zvýší a sníží úroveň odsazení a vygeneruje trasovací zprávy.

Trace.WriteLine("List of errors:");
Trace.Indent();
Trace.WriteLine("Error 1: File not found");
Trace.WriteLine("Error 2: Directory not found");
Trace.Unindent();
Trace.WriteLine("End of list of errors");
Trace.WriteLine("List of errors:")
Trace.Indent()
Trace.WriteLine("Error 1: File not found")
Trace.WriteLine("Error 2: Directory not found")
Trace.Unindent()
Trace.WriteLine("End of list of errors")

Tento příklad vytvoří následující výstup:

List of errors:
     Error 1: File not found
     Error 2: Directory not found
End of list of errors

Platí pro

Viz také