Trace.IndentSize 属性

定义

获取或设置缩进的空格数。Gets or sets the number of spaces in an indent.

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

缩进的空格数。The number of spaces in an indent. 默认值为四。The default is four.

注解

TextWriterTraceListener 此数字解释为空格。A TextWriterTraceListener interprets this number as spaces. EventLogTraceListener忽略此值。An EventLogTraceListener ignores this value.

此属性基于每个线程/每个请求存储。This property is stored on per-thread/per-request basis.

若要为 AutoFlush 设置 IndentSizeTrace ,还可以编辑与应用程序名称对应的配置文件。To set the AutoFlush and IndentSize for Trace, you can also edit the configuration file that corresponds to the name of your application. 配置文件的格式应类似于以下示例:The configuration file should be formatted like the following example:

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

适用于

另请参阅