Bewerken

Delen via


IndentedTextWriter Constructors

Definition

Initializes a new instance of the IndentedTextWriter class using the specified text writer and default tab string.

Overloads

IndentedTextWriter(TextWriter)

Initializes a new instance of the IndentedTextWriter class using the specified text writer and default tab string.

IndentedTextWriter(TextWriter, String)

Initializes a new instance of the IndentedTextWriter class using the specified text writer and tab string.

IndentedTextWriter(TextWriter)

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

Initializes a new instance of the IndentedTextWriter class using the specified text writer and default tab string.

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)

Parameters

writer
TextWriter

The TextWriter to use for output.

See also

Applies to

IndentedTextWriter(TextWriter, String)

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

Initializes a new instance of the IndentedTextWriter class using the specified text writer and tab string.

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)

Parameters

writer
TextWriter

The TextWriter to use for output.

tabString
String

The tab string to use for indentation.

Examples

The following code example demonstrates creating an IndentedTextWriter using a specified tab string.

// 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, "    ")

See also

Applies to