Trace.IndentSize 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定縮排的空格數目。
public:
static property int IndentSize { int get(); void set(int value); };
C#
public static int IndentSize { get; set; }
static member IndentSize : int with get, set
Public Shared Property IndentSize As Integer
縮排中的空格數目。 預設值為 4。
會將 TextWriterTraceListener 這個數位解譯為空格。 EventLogTraceListener忽略此值。
此屬性會以每個線程/每個要求為基礎儲存。
若要在 .NET Framework 應用程式中設定 AutoFlush 和 IndentSizeTrace ,您也可以編輯對應至應用程式名稱的組態檔。 組態檔的格式應該如下列範例所示:
XML
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="3" />
</system.diagnostics>
</configuration>
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |