共用方式為


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。

範例

以下範例設定縮排層級並發出除錯訊息。

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 排被套用的次數。

適用於

另請參閱