Trace.IndentSize 屬性

定義

取得或設定縮排的空格數目。

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

屬性值

縮排中的空格數目。 預設值為 4。

備註

會將 TextWriterTraceListener 這個數位解譯為空格。 EventLogTraceListener忽略此值。

此屬性會以每個線程/每個要求為基礎儲存。

若要在 .NET Framework 應用程式中設定 AutoFlushIndentSizeTrace ,您也可以編輯對應至應用程式名稱的組態檔。 組態檔的格式應該如下列範例所示:

<configuration>  
  <system.diagnostics>  
    <trace autoflush="false" indentsize="3" />  
  </system.diagnostics>  
</configuration>  

適用於

另請參閱