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
IndentationString
public string IndentationString { get; set; }
Property Value
Length
public int Length { get; }
Property Value
Location
public TextLocation Location { get; }
Property Value
Methods
ContainsNonPrintableIdentifierChar(string)
public static bool ContainsNonPrintableIdentifierChar(string identifier)
Parameters
identifier
string
Returns
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
ConvertString(string)
Converts special characters to escape sequences within the given string.
public static string ConvertString(string str)
Parameters
str
string
Returns
EndNode(AstNode)
public override void EndNode(AstNode node)
Parameters
node
AstNode
EscapeIdentifier(string)
public static string EscapeIdentifier(string identifier)
Parameters
identifier
string
Returns
Indent()
public override void Indent()
NewLine()
public override void NewLine()
PrintPrimitiveValue(object)
public static string PrintPrimitiveValue(object value)
Parameters
value
object
Returns
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
CommentTypecontent
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
WritePreProcessorDirective(PreProcessorDirectiveType, string)
public override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)
Parameters
type
PreProcessorDirectiveTypeargument
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
objectformat
LiteralFormat
WriteToken(Role, string)
Writes a token to the output.
public override void WriteToken(Role role, string token)