C# 클래스 TextTools.TextTable

A class for rendering text based tables. This class needs just a printing function (like Console.WriteLine) and the maximum width of the table that has to be rendered. Therefore it is suitable for use in linux consoles with Mono
파일 보기 프로젝트 열기: txdv/sharpmod 1 사용 예제들

공개 메소드들

메소드 설명
Render ( IList data ) : void

The Render function which uses Console.Write for printing and Console.WindowWith to determine the with of the console.

Render ( IList data, OutputFunction outputFunction, int maximumWidth ) : void

The classic Render functions, which lets you supply the maximum width and the function which has to be used for printing.

TextTable ( IList
header ) : System

A constructor which requires an array of Header or a class with the IList

interaface implemeneted.

TextTable ( IList header ) : System

A constructor which requires an array of strings or a class with the IList interaface implemeneted. Internally the array will be converted in an array of Header with the default values used in TextTable.

보호된 메소드들

메소드 설명
GetHeaderArrayOfStringArray ( IList header ) : TextTools.Header[]

A function for converting the string array into a header array, needed to fit in the constructor.

GetLongestDataEntryLength ( IList data, int row ) : int

Gets the longest data entry length in a data set of a specific row.

GetLongestDataEntryLengthArray ( IList data ) : int[]

Gets the longest data entry lengths of all rows.

Trim ( Align alignment, string text, int length ) : string

Trims the text according to length and alignment.

메소드 상세

GetHeaderArrayOfStringArray() 보호된 정적인 메소드

A function for converting the string array into a header array, needed to fit in the constructor.
protected static GetHeaderArrayOfStringArray ( IList header ) : TextTools.Header[]
header IList /// An array of strings ///
리턴 TextTools.Header[]

GetLongestDataEntryLength() 보호된 메소드

Gets the longest data entry length in a data set of a specific row.
protected GetLongestDataEntryLength ( IList data, int row ) : int
data IList /// A data object ///
row int /// The row to examine ///
리턴 int

GetLongestDataEntryLengthArray() 보호된 메소드

Gets the longest data entry lengths of all rows.
protected GetLongestDataEntryLengthArray ( IList data ) : int[]
data IList /// A data object ///
리턴 int[]

Render() 공개 메소드

The Render function which uses Console.Write for printing and Console.WindowWith to determine the with of the console.
public Render ( IList data ) : void
data IList /// A data object, the second dimension must fit the header length. ///
리턴 void

Render() 공개 메소드

The classic Render functions, which lets you supply the maximum width and the function which has to be used for printing.
public Render ( IList data, OutputFunction outputFunction, int maximumWidth ) : void
data IList /// A data object ///
outputFunction OutputFunction /// A delegate to the output function ///
maximumWidth int /// the maximum width of the table ///
리턴 void

TextTable() 공개 메소드

A constructor which requires an array of Header or a class with the IList
interaface implemeneted.
public TextTable ( IList
header ) : System
header IList
/// A header array ///
리턴 System

TextTable() 공개 메소드

A constructor which requires an array of strings or a class with the IList interaface implemeneted. Internally the array will be converted in an array of Header with the default values used in TextTable.
public TextTable ( IList header ) : System
header IList /// A string array ///
리턴 System

Trim() 보호된 메소드

Trims the text according to length and alignment.
protected Trim ( Align alignment, string text, int length ) : string
alignment Align /// Alignment value ///
text string /// Text to trim ///
length int /// The maximum length ///
리턴 string