Table of Contents

Class TextWriterTokenWriter

Namespace
ICSharpCode.Decompiler.CSharp.OutputVisitor
Assembly
ICSharpCode.Decompiler.dll

Writes C# code into a TextWriter.

public class TextWriterTokenWriter : TokenWriter, ILocatable
Inheritance
TextWriterTokenWriter
Implements
Inherited Members

Constructors

TextWriterTokenWriter(TextWriter)

public TextWriterTokenWriter(TextWriter textWriter)

Parameters

textWriter TextWriter

Properties

Indentation

public int Indentation { get; set; }

Property Value

int

IndentationString

public string IndentationString { get; set; }

Property Value

string

Length

public int Length { get; }

Property Value

int

Location

public TextLocation Location { get; }

Property Value

TextLocation

Methods

ContainsNonPrintableIdentifierChar(string)

public static bool ContainsNonPrintableIdentifierChar(string identifier)

Parameters

identifier string

Returns

bool

ConvertCharLiteral(char)

Gets the escape sequence for the specified character within a char literal. Does not include the single quotes surrounding the char literal.

public static string ConvertCharLiteral(char ch)

Parameters

ch char

Returns

string

ConvertString(string)

Converts special characters to escape sequences within the given string.

public static string ConvertString(string str)

Parameters

str string

Returns

string

EndNode(AstNode)

public override void EndNode(AstNode node)

Parameters

node AstNode

EscapeIdentifier(string)

public static string EscapeIdentifier(string identifier)

Parameters

identifier string

Returns

string

Indent()

public override void Indent()

NewLine()

public override void NewLine()

PrintPrimitiveValue(object)

public static string PrintPrimitiveValue(object value)

Parameters

value object

Returns

string

Space()

public override void Space()

StartNode(AstNode)

public override void StartNode(AstNode node)

Parameters

node AstNode

Unindent()

public override void Unindent()

WriteComment(CommentType, string)

public override void WriteComment(CommentType commentType, string content)

Parameters

commentType CommentType
content string

WriteIdentifier(Identifier)

Writes an identifier.

public override void WriteIdentifier(Identifier identifier)

Parameters

identifier Identifier

WriteIndentation()

protected void WriteIndentation()

WriteInterpolatedText(string)

Write a piece of text in an interpolated string literal.

public override void WriteInterpolatedText(string text)

Parameters

text string

WriteKeyword(Role, string)

Writes a keyword to the output.

public override void WriteKeyword(Role role, string keyword)

Parameters

role Role
keyword string

WritePreProcessorDirective(PreProcessorDirectiveType, string)

public override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)

Parameters

type PreProcessorDirectiveType
argument string

WritePrimitiveType(string)

public override void WritePrimitiveType(string type)

Parameters

type string

WritePrimitiveValue(object, LiteralFormat)

Writes a primitive/literal value

public override void WritePrimitiveValue(object value, LiteralFormat format = LiteralFormat.None)

Parameters

value object
format LiteralFormat

WriteToken(Role, string)

Writes a token to the output.

public override void WriteToken(Role role, string token)

Parameters

role Role
token string