Trace.IndentLevel 속성

정의

들여쓰기 수준을 가져오거나 설정합니다.

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

속성 값

들여쓰기 수준입니다. 기본값은 0입니다.

예제

다음 예제에서는 들여쓰기 수준을 증가 및 감소시키고 추적 메시지를 내보낸다.

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  

설명

속성은 IndentLevel 크기 IndentSize 들여쓰기를 적용한 횟수를 나타냅니다. 이 속성은 스레드당/요청별로 저장됩니다.

적용 대상

추가 정보