IndentedTextWriter 构造函数

定义

使用指定的文本编写器和默认制表符字符串初始化类的新实例 IndentedTextWriter

重载

名称 说明
IndentedTextWriter(TextWriter)

使用指定的文本编写器和默认制表符字符串初始化类的新实例 IndentedTextWriter

IndentedTextWriter(TextWriter, String)

使用指定的文本编写器和制表符字符串初始化类的新实例 IndentedTextWriter

IndentedTextWriter(TextWriter)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

使用指定的文本编写器和默认制表符字符串初始化类的新实例 IndentedTextWriter

public:
 IndentedTextWriter(System::IO::TextWriter ^ writer);
public IndentedTextWriter(System.IO.TextWriter writer);
new System.CodeDom.Compiler.IndentedTextWriter : System.IO.TextWriter -> System.CodeDom.Compiler.IndentedTextWriter
Public Sub New (writer As TextWriter)

参数

writer
TextWriter

TextWriter要用于输出。

另请参阅

适用于

IndentedTextWriter(TextWriter, String)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

使用指定的文本编写器和制表符字符串初始化类的新实例 IndentedTextWriter

public:
 IndentedTextWriter(System::IO::TextWriter ^ writer, System::String ^ tabString);
public IndentedTextWriter(System.IO.TextWriter writer, string tabString);
new System.CodeDom.Compiler.IndentedTextWriter : System.IO.TextWriter * string -> System.CodeDom.Compiler.IndentedTextWriter
Public Sub New (writer As TextWriter, tabString As String)

参数

writer
TextWriter

TextWriter要用于输出。

tabString
String

用于缩进的制表符字符串。

示例

下面的代码示例演示如何使用指定的选项卡字符串创建 IndentedTextWriter

// Creates a TextWriter to use as the base output writer.
System.IO.StringWriter baseTextWriter = new System.IO.StringWriter();

// Create an IndentedTextWriter and set the tab string to use
// as the indentation string for each indentation level.
System.CodeDom.Compiler.IndentedTextWriter indentWriter = new IndentedTextWriter(baseTextWriter, "    ");
  ' Create a TextWriter to use as the base output writer.
  Dim baseTextWriter As New System.IO.StringWriter

  ' Create an IndentedTextWriter and set the tab string to use 
  ' as the indentation string for each indentation level.
  Dim indentWriter = New IndentedTextWriter(baseTextWriter, "    ")

另请参阅

适用于