IndentedTextWriter 构造函数

定义

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

重载

IndentedTextWriter(TextWriter)

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

IndentedTextWriter(TextWriter, String)

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

IndentedTextWriter(TextWriter)

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

使用指定的文本编写器和默认 Tab 字符串,初始化 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

使用指定的文本编写器和 Tab 字符串初始化 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

用于缩进的 Tab 字符串。

示例

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

// Creates a TextWriter to use as the base output writer.
System::IO::StringWriter^ baseTextWriter = gcnew 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 = gcnew IndentedTextWriter( baseTextWriter,"    " );
// 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, "    ")

另请参阅

适用于