Trace.IndentSize 属性

定义

获取或设置缩进的空格数。

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

属性值

Int32

缩进的空格数。 默认值为四。

注解

一个 TextWriterTraceListener 将此数字解释为空格。 忽略 EventLogTraceListener 此值。

此属性基于每个线程/每个请求存储。

若要在.NET Framework应用中设置AutoFlushIndentSize设置Trace,还可以编辑对应于应用程序名称的配置文件。 配置文件的格式应如以下示例所示:

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

适用于

另请参阅