語言

IndentedTextWriter 建構函式

定義

使用指定的文字編入器和預設的 tab 字串初始化該 IndentedTextWriter 類別的新實例。

多載

名稱 Description
IndentedTextWriter(TextWriter)

使用指定的文字編入器和預設的 tab 字串初始化該 IndentedTextWriter 類別的新實例。

IndentedTextWriter(TextWriter, String)

使用指定的文字寫入器和 tab 字串初始化該類別的新實例 IndentedTextWriter 。

IndentedTextWriter(TextWriter)

來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
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)

來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
IndentedTextWriter.cs
來源:
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

用來縮排的制表字串。

範例

以下程式碼範例示範使用指定的制表字串來建立 。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, "    ")

另請參閱

適用於