Trace.IndentSize 属性

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

**命名空间:**System.Diagnostics
**程序集:**System(在 system.dll 中)

语法

声明
Public Shared Property IndentSize As Integer
用法
Dim value As Integer

value = Trace.IndentSize

Trace.IndentSize = value
public static int IndentSize { get; set; }
public:
static property int IndentSize {
    int get ();
    void set (int value);
}
/** @property */
public static int get_IndentSize ()

/** @property */
public static void set_IndentSize (int value)
public static function get IndentSize () : int

public static function set IndentSize (value : int)

属性值

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

备注

TextWriterTraceListener 将该数字解释为空格。EventLogTraceListener 忽略该值。

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

若要为 Trace 设置 AutoFlushIndentSize,也可以编辑与应用程序的名称相对应的配置文件。应像下面的示例这样对配置文件进行格式化:

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

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Trace 类
Trace 成员
System.Diagnostics 命名空间
Trace.IndentLevel 属性
Debug 类
Trace 类
BooleanSwitch 类
TraceSwitch
TraceListener
DefaultTraceListener 类
ConditionalAttribute 类