System.CodeDom.Compiler.IndentedTextWriter Class

Assembly: System.dll
Namespace: System.CodeDom.Compiler
Summary
Provides a text writer that can indent new lines by a tab string token.
C# Syntax:
public class IndentedTextWriter : TextWriter
Remarks
IndentedTextWriter extends a TextWriter by providing methods that insert a tab string and track the current indentation level. Text formatted with multiple indentation levels is useful for generated code, so this class is used by CodeDOM code generator implementations.

The tab string is the string that each indentation consists of. Typically the tab string contains white space.

See also:
System.CodeDom.Compiler Namespace

System.CodeDom.Compiler.IndentedTextWriter Member List:

Public Constructors
ctor #1 Overloaded:
.ctor(TextWriter writer)

Initializes a new instance of the IndentedTextWriter class using the specified text writer and default tab string.
ctor #2 Overloaded:
.ctor(TextWriter writer, string tabString)

Initializes a new instance of the IndentedTextWriter class using the specified text writer and tab string.
Public Fields
DefaultTabString Gets or sets the default tab string.
Public Properties
Encoding Read-only

Overridden:
Gets the encoding for the text writer to use.
FormatProvider
(inherited from System.IO.TextWriter)
Read-only

See base class member description: System.IO.TextWriter.FormatProvider


Gets an object that controls formatting.
Indent Read-write

Gets or sets the number of spaces to indent.
InnerWriter Read-only

Gets the TextWriter to use.
NewLine Read-write

Overridden:
Gets or sets the new line character to use.
Public Methods
Close Overridden:
Closes the document being written to.
CreateObjRef
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.CreateObjRef


Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
Flush Overridden:
Flushes the stream.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetLifetimeService
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.GetLifetimeService


Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
InitializeLifetimeService
(inherited from System.MarshalByRefObject)
See base class member description: System.MarshalByRefObject.InitializeLifetimeService


Obtains a lifetime service object to control the lifetime policy for this instance.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Write Overloaded:
Write(bool value)

Overridden:
Writes the text representation of a Boolean value to the text stream.
Write Overloaded:
Write(char value)

Overridden:
Writes a character to the text stream.
Write Overloaded:
Write(char[] buffer)

Overridden:
Writes a character array to the text stream.
Write
(inherited from System.IO.TextWriter)
Overloaded:
Write(decimal value)

See base class member description: System.IO.TextWriter.Write


Writes the text representation of a decimal value followed by a line terminator to the text stream.
Write Overloaded:
Write(double value)

Overridden:
Writes the text representation of a Double to the text stream.
Write Overloaded:
Write(int value)

Overridden:
Writes the text representation of an integer to the text stream.
Write Overloaded:
Write(long value)

Overridden:
Writes the text representation of an 8-byte integer to the text stream.
Write Overloaded:
Write(object value)

Overridden:
Writes the text representation of an object to the text stream.
Write Overloaded:
Write(float value)

Overridden:
Writes the text representation of a Single to the text stream.
Write Overloaded:
Write(string s)

Overridden:
Writes the specified string to the text stream.
Write
(inherited from System.IO.TextWriter)
Overloaded:
Write(uint value)

See base class member description: System.IO.TextWriter.Write


Writes the text representation of a 4-byte unsigned integer to the text stream.
Write
(inherited from System.IO.TextWriter)
Overloaded:
Write(ulong value)

See base class member description: System.IO.TextWriter.Write


Writes the text representation of an 8-byte unsigned integer to the text stream.
Write Overloaded:
Write(string format, object arg0)

Overridden:
Writes out a formatted string, using the same semantics as specified.
Write Overloaded:
Write(string format, params object[] arg)

Overridden:
Writes out a formatted string, using the same semantics as specified.
Write Overloaded:
Write(char[] buffer, int index, int count)

Overridden:
Writes a subarray of characters to the text stream.
Write Overloaded:
Write(string format, object arg0, object arg1)

Overridden:
Writes out a formatted string, using the same semantics as specified.
Write
(inherited from System.IO.TextWriter)
Overloaded:
Write(string format, object arg0, object arg1, object arg2)

See base class member description: System.IO.TextWriter.Write


Writes out a formatted string, using the same semantics as String.Format.
WriteLine Overloaded:
WriteLine()

Overridden:
Writes a line terminator.
WriteLine Overloaded:
WriteLine(bool value)

Overridden:
Writes the text representation of a Boolean, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(char value)

Overridden:
Writes a character, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(char[] buffer)

Overridden:
Writes a character array, followed by a line terminator, to the text stream.
WriteLine
(inherited from System.IO.TextWriter)
Overloaded:
WriteLine(decimal value)

See base class member description: System.IO.TextWriter.WriteLine


Writes the text representation of a decimal value followed by a line terminator to the text stream.
WriteLine Overloaded:
WriteLine(double value)

Overridden:
Writes the text representation of a Double, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(int value)

Overridden:
Writes the text representation of an integer, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(long value)

Overridden:
Writes the text representation of an 8-byte integer, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(object value)

Overridden:
Writes the text representation of an object, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(float value)

Overridden:
Writes the text representation of a Single, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(string s)

Overridden:
Writes the specified string, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(uint value)

Overridden:
Writes the text representation of a UInt32, followed by a line terminator, to the text stream.
WriteLine
(inherited from System.IO.TextWriter)
Overloaded:
WriteLine(ulong value)

See base class member description: System.IO.TextWriter.WriteLine


Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the text stream.
WriteLine Overloaded:
WriteLine(string format, object arg0)

Overridden:
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
WriteLine Overloaded:
WriteLine(string format, params object[] arg)

Overridden:
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
WriteLine Overloaded:
WriteLine(char[] buffer, int index, int count)

Overridden:
Writes a subarray of characters, followed by a line terminator, to the text stream.
WriteLine Overloaded:
WriteLine(string format, object arg0, object arg1)

Overridden:
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
WriteLine
(inherited from System.IO.TextWriter)
Overloaded:
WriteLine(string format, object arg0, object arg1, object arg2)

See base class member description: System.IO.TextWriter.WriteLine


Writes out a formatted string and a new line, using the same semantics as String.Format.
WriteLineNoTabs Writes the specified string to a line without tabs.
Protected Fields
CoreNewLine
(inherited from System.IO.TextWriter)
See base class member description: System.IO.TextWriter.CoreNewLine


Stores the new line characters used for this TextWriter.
Protected Methods
Dispose
(inherited from System.IO.TextWriter)
See base class member description: System.IO.TextWriter.Dispose


Releases the unmanaged resources used by the TextWriter and optionally releases the managed resources.
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.
OutputTabs Outputs the tab string once for each level of indentation according to the IndentedTextWriter.Indent property.

Hierarchy:


System.CodeDom.Compiler.IndentedTextWriter Member Details

Overloaded ctor #1
Summary
Initializes a new instance of the IndentedTextWriter class using the specified text writer and default tab string.
C# Syntax:
public IndentedTextWriter(
   TextWriter writer
);
Parameters:

writer

The TextWriter to use for output.

See also:
TextWriter

Return to top


Overloaded ctor #2
Summary
Initializes a new instance of the IndentedTextWriter class using the specified text writer and tab string.
C# Syntax:
public IndentedTextWriter(
   TextWriter writer,
   string tabString
);
Parameters:

writer

The TextWriter to use for output.

tabString

The tab string to use for indentation.

See also:
TextWriter

Return to top


Field: CoreNewLine
Inherited
See base class member description: System.IO.TextWriter.CoreNewLine

Summary
Stores the new line characters used for this TextWriter.
C# Syntax:
protected char[] CoreNewLine;

Return to top


Field: DefaultTabString
Summary
Gets or sets the default tab string.
C# Syntax:
public const string DefaultTabString;
Remarks
The default tab string consists of a single white space. (" ")

Return to top


Overridden Property: Encoding (read-only)
Summary
Gets the encoding for the text writer to use.
C# Syntax:
public override Encoding Encoding {get;}

Return to top


Property: FormatProvider (read-only)
Inherited
See base class member description: System.IO.TextWriter.FormatProvider

Summary
Gets an object that controls formatting.
C# Syntax:
public virtual IFormatProvider FormatProvider {get;}

Return to top


Property: Indent (read-write)
Summary
Gets or sets the number of spaces to indent.
C# Syntax:
public int Indent {get; set;}

Return to top


Property: InnerWriter (read-only)
Summary
Gets the TextWriter to use.
C# Syntax:
public TextWriter InnerWriter {get;}

Return to top


Overridden Property: NewLine (read-write)
Summary
Gets or sets the new line character to use.
C# Syntax:
public override string NewLine {get; set;}

Return to top


Overridden Method: Close()
Summary
Closes the document being written to.
C# Syntax:
public override void Close();

Return to top


Method: CreateObjRef(
   Type requestedType
)
Inherited
See base class member description: System.MarshalByRefObject.CreateObjRef

Summary
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
C# Syntax:
public virtual ObjRef CreateObjRef(
   Type requestedType
);
Parameters:

requestedType

The Type of the object that the new ObjRef will reference.

Return Value:
Information required to generate a proxy.
Exceptions
Exception Type Condition
RemotingException This instance is not a valid remoting object.

Return to top


Method: Dispose(
   bool disposing
)
Inherited
See base class member description: System.IO.TextWriter.Dispose

Summary
Releases the unmanaged resources used by the TextWriter and optionally releases the managed resources.
C# Syntax:
protected virtual void Dispose(
   bool disposing
);
Parameters:

disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Object.Finalize method.Dispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Object.Finalize invokes Dispose with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this TextWriter references. This method invokes the Dispose() method of each referenced object.



Notes to inheritors: Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed of in an earlier call to Dispose. For more information about how to implement Dispose(Boolean), see the conceptual topic at MSDN: implementingdisposemethod.

For more information about Dispose and Object.Finalize, see the conceptual topic at MSDN: cleaningupunmanagedresources and the conceptual topic at MSDN: overridingfinalizemethod.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~IndentedTextWriter();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: Flush()
Summary
Flushes the stream.
C# Syntax:
public override void Flush();
Remarks
This clears the stream of any data.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetLifetimeService()
Inherited
See base class member description: System.MarshalByRefObject.GetLifetimeService

Summary
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
C# Syntax:
public object GetLifetimeService();
Return Value:
An object of type ILease used to control the lifetime policy for this instance.
Remarks
For more information about lifetime services, see the LifetimeServices class.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: InitializeLifetimeService()
Inherited
See base class member description: System.MarshalByRefObject.InitializeLifetimeService

Summary
Obtains a lifetime service object to control the lifetime policy for this instance.
C# Syntax:
public virtual object InitializeLifetimeService();
Return Value:
An object of type ILease used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the LifetimeServices.LeaseManagerPollTime property.
Remarks
For more information about lifetime services, see the LifetimeServices class.
Example
The following code example demonstrates creating a lease.
 public class MyClass : MarshalByRefObject
 {
   public override Object InitializeLifetimeService()
   {
     ILease lease = (ILease)base.InitializeLifetimeService();
     if (lease.CurrentState == LeaseState.Initial)
     {
          lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
          lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
           lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
     }
       return lease;
   }
 }

    

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: OutputTabs()
Summary
Outputs the tab string once for each level of indentation according to the IndentedTextWriter.Indent property.
C# Syntax:
protected virtual void OutputTabs();

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Overloaded Method: Write(
   bool value
)
Summary
Writes the text representation of a Boolean value to the text stream.
C# Syntax:
public override void Write(
   bool value
);
Parameters:

value

The Boolean value to write.

Return to top


Overloaded Method: Write(
   char value
)
Summary
Writes a character to the text stream.
C# Syntax:
public override void Write(
   char value
);
Parameters:

value

The character to write.

Return to top


Overloaded Method: Write(
   char[] buffer
)
Summary
Writes a character array to the text stream.
C# Syntax:
public override void Write(
   char[] buffer
);
Parameters:

buffer

The character array to write.

Return to top


Overloaded Method: Write(
   decimal value
)
Inherited
See base class member description: System.IO.TextWriter.Write

Summary
Writes the text representation of a decimal value followed by a line terminator to the text stream.
C# Syntax:
public virtual void Write(
   decimal value
);
Parameters:

value

The decimal value to write.

Exceptions
Exception Type Condition
IOException An I/O error occurs.

Return to top


Overloaded Method: Write(
   double value
)
Summary
Writes the text representation of a Double to the text stream.
C# Syntax:
public override void Write(
   double value
);
Parameters:

value

The double to write.

Return to top


Overloaded Method: Write(
   int value
)
Summary
Writes the text representation of an integer to the text stream.
C# Syntax:
public override void Write(
   int value
);
Parameters:

value

The integer to write.

Return to top


Overloaded Method: Write(
   long value
)
Summary
Writes the text representation of an 8-byte integer to the text stream.
C# Syntax:
public override void Write(
   long value
);
Parameters:

value

The 8-byte integer to write.

Return to top


Overloaded Method: Write(
   object value
)
Summary
Writes the text representation of an object to the text stream.
C# Syntax:
public override void Write(
   object value
);
Parameters:

value

The object to write.

Return to top


Overloaded Method: Write(
   float value
)
Summary
Writes the text representation of a Single to the text stream.
C# Syntax:
public override void Write(
   float value
);
Parameters:

value

The single to write.

Return to top


Overloaded Method: Write(
   string s
)
Summary
Writes the specified string to the text stream.
C# Syntax:
public override void Write(
   string s
);
Parameters:

s

The string to write.

Return to top


Overloaded Method: Write(
   uint value
)
Inherited
See base class member description: System.IO.TextWriter.Write

Summary
Writes the text representation of a 4-byte unsigned integer to the text stream.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public virtual void Write(
   uint value
);
Parameters:

value

The 4-byte unsigned integer to write.

Exceptions
Exception Type Condition
IOException An I/O error occurs, such as the stream being closed.
Remarks
The text representation of the specified value is produced by calling UInt32.ToString.

Return to top


Overloaded Method: Write(
   ulong value
)
Inherited
See base class member description: System.IO.TextWriter.Write

Summary
Writes the text representation of an 8-byte unsigned integer to the text stream.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public virtual void Write(
   ulong value
);
Parameters:

value

The 8-byte unsigned integer to write.

Exceptions
Exception Type Condition
IOException An I/O error occurs, such as the stream being closed.
Remarks
The text representation of the specified value is produced by calling UInt64.ToString.

Return to top


Overloaded Method: Write(
   string format,
   object arg0
)
Summary
Writes out a formatted string, using the same semantics as specified.
C# Syntax:
public override void Write(
   string format,
   object arg0
);
Parameters:

format

The formatting string.

arg0

The object to write into the formatted string.

Return to top


Overloaded Method: Write(
   string format,
   params object[] arg
)
Summary
Writes out a formatted string, using the same semantics as specified.
C# Syntax:
public override void Write(
   string format,
   params object[] arg
);
Parameters:

format

The formatting string to use.

arg

The argument array to output.

Return to top


Overloaded Method: Write(
   char[] buffer,
   int index,
   int count
)
Summary
Writes a subarray of characters to the text stream.
C# Syntax:
public override void Write(
   char[] buffer,
   int index,
   int count
);
Parameters:

buffer

The character array to write data from.

index

Starting index in the buffer.

count

The number of characters to write.

Return to top


Overloaded Method: Write(
   string format,
   object arg0,
   object arg1
)
Summary
Writes out a formatted string, using the same semantics as specified.
C# Syntax:
public override void Write(
   string format,
   object arg0,
   object arg1
);
Parameters:

format

The formatting string to use.

arg0

The first object to write into the formatted string.

arg1

The second object to write into the formatted string.

Return to top


Overloaded Method: Write(
   string format,
   object arg0,
   object arg1,
   object arg2
)
Inherited
See base class member description: System.IO.TextWriter.Write

Summary
Writes out a formatted string, using the same semantics as String.Format.
C# Syntax:
public virtual void Write(
   string format,
   object arg0,
   object arg1,
   object arg2
);
Parameters:

format

The formatting string.

arg0

An object to write into the formatted string.

arg1

An object to write into the formatted string.

arg2

An object to write into the formatted string.

Exceptions
Exception Type Condition
ArgumentNullException format or any of the arg parameters is null.

-or-

An object referenced in the format string is null.

IOException An I/O error occurs, such as the stream being closed.
FormatException The format specification in format is invalid.

-or-

The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted .

Remarks
This version of TextWriter.Write is equivalent to ( (format, arg0, arg1, arg2)).

This method does not search the specified String for individual newline characters(hexadecimal 0x000a) and replace them with TextWriter.NewLine.

If a specified object is not referenced in the format string, it is ignored.

Return to top


Overloaded Method: WriteLine()
Summary
Writes a line terminator.
C# Syntax:
public override void WriteLine();

Return to top


Overloaded Method: WriteLine(
   bool value
)
Summary
Writes the text representation of a Boolean, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   bool value
);
Parameters:

value

The Boolean to write.

Return to top


Overloaded Method: WriteLine(
   char value
)
Summary
Writes a character, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   char value
);
Parameters:

value

The character to write.

Return to top


Overloaded Method: WriteLine(
   char[] buffer
)
Summary
Writes a character array, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   char[] buffer
);
Parameters:

buffer

The character array to write.

Return to top


Overloaded Method: WriteLine(
   decimal value
)
Inherited
See base class member description: System.IO.TextWriter.WriteLine

Summary
Writes the text representation of a decimal value followed by a line terminator to the text stream.
C# Syntax:
public virtual void WriteLine(
   decimal value
);
Parameters:

value

The decimal value to write.

Exceptions
Exception Type Condition
IOException An I/O error occurs.

Return to top


Overloaded Method: WriteLine(
   double value
)
Summary
Writes the text representation of a Double, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   double value
);
Parameters:

value

The double to write.

Return to top


Overloaded Method: WriteLine(
   int value
)
Summary
Writes the text representation of an integer, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   int value
);
Parameters:

value

The integer to write.

Return to top


Overloaded Method: WriteLine(
   long value
)
Summary
Writes the text representation of an 8-byte integer, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   long value
);
Parameters:

value

The 8-byte integer to write.

Return to top


Overloaded Method: WriteLine(
   object value
)
Summary
Writes the text representation of an object, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   object value
);
Parameters:

value

The object to write.

Return to top


Overloaded Method: WriteLine(
   float value
)
Summary
Writes the text representation of a Single, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   float value
);
Parameters:

value

The single to write.

Return to top


Overloaded Method: WriteLine(
   string s
)
Summary
Writes the specified string, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   string s
);
Parameters:

s

The string to write.

Return to top


Overloaded Method: WriteLine(
   uint value
)
Summary
Writes the text representation of a UInt32, followed by a line terminator, to the text stream.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public override void WriteLine(
   uint value
);
Parameters:

value

A UInt32 to output.

Return to top


Overloaded Method: WriteLine(
   ulong value
)
Inherited
See base class member description: System.IO.TextWriter.WriteLine

Summary
Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the text stream.
This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public virtual void WriteLine(
   ulong value
);
Parameters:

value

The 8-byte unsigned integer to write.

Exceptions
Exception Type Condition
IOException An I/O error occurs, such as the stream being closed.
Remarks
The text representation of the specified value is produced by calling UInt64.ToString.

Return to top


Overloaded Method: WriteLine(
   string format,
   object arg0
)
Summary
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
C# Syntax:
public override void WriteLine(
   string format,
   object arg0
);
Parameters:

format

The formatting string.

arg0

The object to write into the formatted string.

Return to top


Overloaded Method: WriteLine(
   string format,
   params object[] arg
)
Summary
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
C# Syntax:
public override void WriteLine(
   string format,
   params object[] arg
);
Parameters:

format

The formatting string to use.

arg

The argument array to output.

Return to top


Overloaded Method: WriteLine(
   char[] buffer,
   int index,
   int count
)
Summary
Writes a subarray of characters, followed by a line terminator, to the text stream.
C# Syntax:
public override void WriteLine(
   char[] buffer,
   int index,
   int count
);
Parameters:

buffer

The character array to write data from.

index

Starting index in the buffer.

count

The number of characters to write.

Return to top


Overloaded Method: WriteLine(
   string format,
   object arg0,
   object arg1
)
Summary
Writes out a formatted string, followed by a line terminator, using the same semantics as specified.
C# Syntax:
public override void WriteLine(
   string format,
   object arg0,
   object arg1
);
Parameters:

format

The formatting string to use.

arg0

The first object to write into the formatted string.

arg1

The second object to write into the formatted string.

Return to top


Overloaded Method: WriteLine(
   string format,
   object arg0,
   object arg1,
   object arg2
)
Inherited
See base class member description: System.IO.TextWriter.WriteLine

Summary
Writes out a formatted string and a new line, using the same semantics as String.Format.
C# Syntax:
public virtual void WriteLine(
   string format,
   object arg0,
   object arg1,
   object arg2
);
Parameters:

format

The formatting string.

arg0

The object to write into format string.

arg1

The object to write into format string.

arg2

The object to write into format string.

Exceptions
Exception Type Condition
ArgumentNullException A string or object is passed in as null.

-or-

An object referenced in the format string is null.

IOException An I/O error occurs, such as the stream being closed.
FormatException The format specification in format is invalid.

-or-

The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted.

Remarks
This version of TextWriter.WriteLine is equivalent to ( (format, arg0, arg1, arg2)).

This method does not search the specified String for individual newline characters(hexadecimal 0x000a) and replace them with TextWriter.NewLine.

If a specified object is not referenced in the format string, it is ignored.

Return to top


Method: WriteLineNoTabs(
   string s
)
Summary
Writes the specified string to a line without tabs.
C# Syntax:
public void WriteLineNoTabs(
   string s
);
Parameters:

s

The string to write.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.