Trace.IndentLevel Proprietà

Definizione

Ottiene o imposta il livello di rientro.

public:
 static property int IndentLevel { int get(); void set(int value); };
public static int IndentLevel { get; set; }
static member IndentLevel : int with get, set
Public Shared Property IndentLevel As Integer

Valore della proprietà

Livello di rientro. Il valore predefinito è zero.

Esempio

Nell'esempio seguente viene incrementato e decrementato il livello di rientro e vengono generati messaggi di traccia.

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

Nell'esempio viene prodotto l'output seguente:

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

Commenti

La IndentLevel proprietà rappresenta il numero di volte in cui viene applicato il rientro delle dimensioni IndentSize . Questa proprietà viene archiviata per ogni thread/per richiesta.

Si applica a

Vedi anche