共用方式為


Trace.Unindent 方法

定義

將目前的 IndentLevel 減少一。

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 ()
屬性

範例

下列範例會遞增和遞減縮排層級,併發出追蹤訊息。

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");
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")

這個範例會產生下列輸出:

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

適用於

另請參閱