C# Class Tp.Utils.Csv.CsvRenderer

Exibir arquivo Open project: TargetProcess/Target-Process-Plugins Class Usage Examples

Public Methods

Method Description
CsvRenderer ( char delimiter, TextWriter textWriter ) : System

Creates new instance of this class.

Render ( IEnumerable columnNames ) : void
StartNewLine ( ) : void

Wraps value writing cursor to new line.

WriteBlock ( StringBuilder stream ) : void
WriteLine ( ) : void

Writes array of values as a row in CSV file.

WriteValue ( string value ) : void

Write single value in the current row at the current cursor position.

Private Methods

Method Description
NeedEscape ( string value ) : bool
WriteEscapedValue ( string value, TextWriter textWriter ) : void

Method Details

CsvRenderer() public method

Creates new instance of this class.
If is null.
public CsvRenderer ( char delimiter, TextWriter textWriter ) : System
delimiter char Delimiter to separate columns.
textWriter System.IO.TextWriter Where to write CSV text.
return System

Render() public method

public Render ( IEnumerable columnNames ) : void
columnNames IEnumerable
return void

StartNewLine() public method

Wraps value writing cursor to new line.
If new line has laready been started.
public StartNewLine ( ) : void
return void

WriteBlock() public method

public WriteBlock ( StringBuilder stream ) : void
stream StringBuilder
return void

WriteLine() public method

Writes array of values as a row in CSV file.
If is empty array. If contains nulls.
public WriteLine ( ) : void
return void

WriteValue() public method

Write single value in the current row at the current cursor position.
public WriteValue ( string value ) : void
value string Single value to write at the current cursor position.
return void