Trace.IndentLevel Propriété

Définition

Obtient ou définit le niveau de retrait.

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

Valeur de propriété

Niveau de retrait. La valeur par défaut est zéro.

Exemples

L’exemple suivant incrémente et décrémente le niveau de retrait et émet des messages de suivi.

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

Cet exemple produit la sortie suivante :

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

Remarques

La IndentLevel propriété représente le nombre de fois où le retrait de la taille IndentSize est appliqué. Cette propriété est stockée par thread/par requête.

S’applique à

Voir aussi