Debug.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。

範例

下列範例會設定縮排層級,併發出偵錯訊息。

#if defined(DEBUG)
Debug::WriteLine( "List of errors:" );
Debug::Indent();
Debug::WriteLine( "Error 1: File not found" );
Debug::WriteLine( "Error 2: Directory not found" );
Debug::Unindent();
Debug::WriteLine( "End of list of errors" );
#endif
Debug.WriteLine("List of errors:");
Debug.Indent();
Debug.WriteLine("Error 1: File not found");
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
Debug.WriteLine("List of errors:")
Debug.Indent()
Debug.WriteLine("Error 1: File not found")
Debug.WriteLine("Error 2: Directory not found")
Debug.Unindent()
Debug.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 縮排的次數。

適用於

另請參閱