Table of Contents

Interface ITextOutputGenerator

Namespace
SunamoInterfaces.Interfaces
Assembly
SunamoInterfaces.dll

Interface for generating formatted text output.

public interface ITextOutputGenerator
Extension Methods

Properties

PrependEveryNoWhite

Gets or sets the string to prepend to every non-whitespace line.

string PrependEveryNoWhite { get; set; }

Property Value

string

Methods

Append(string)

Appends text to the output.

void Append(string text)

Parameters

text string

The text to append.

AppendFormat(string, params string[])

Appends formatted text to the output.

void AppendFormat(string text, params string[] parameters)

Parameters

text string

The format string.

parameters string[]

The parameters for the format string.

AppendLine()

Appends a new line to the output.

void AppendLine()

AppendLine(string)

Appends text followed by a new line.

void AppendLine(string text)

Parameters

text string

The text to append.

AppendLine(StringBuilder)

Appends a StringBuilder's content followed by a new line.

void AppendLine(StringBuilder stringBuilder)

Parameters

stringBuilder StringBuilder

The StringBuilder to append.

AppendLineFormat(string, params string[])

Appends formatted text followed by a new line.

void AppendLineFormat(string text, params string[] parameters)

Parameters

text string

The format string.

parameters string[]

The parameters for the format string.

CountEvery<T>(IList<KeyValuePair<T, int>>)

Outputs count of every item in the list.

void CountEvery<T>(IList<KeyValuePair<T, int>> list)

Parameters

list IList<KeyValuePair<T, int>>

The items with their counts.

Type Parameters

T

The type of the key.

Dictionary(Dictionary<string, List<string>>)

Outputs a dictionary of string keys to string list values.

void Dictionary(Dictionary<string, List<string>> dictionary)

Parameters

dictionary Dictionary<string, List<string>>

The dictionary to output.

Dictionary(Dictionary<string, int>, string)

Outputs a dictionary of string keys to int values.

void Dictionary(Dictionary<string, int> dictionary, string delimiter)

Parameters

dictionary Dictionary<string, int>

The dictionary to output.

delimiter string

The delimiter to use.

Dictionary(Dictionary<string, string>)

Outputs a dictionary of string keys to string values.

void Dictionary(Dictionary<string, string> dictionary)

Parameters

dictionary Dictionary<string, string>

The dictionary to output.

DictionaryBothToStringToSingleLine<Key, Value>(Dictionary<Key, Value>, bool, string)

Converts dictionary to a single line string representation.

string DictionaryBothToStringToSingleLine<Key, Value>(Dictionary<Key, Value> dictionary, bool isPuttingValueAsFirst, string delimiter = " ") where Key : notnull

Parameters

dictionary Dictionary<Key, Value>

The dictionary to convert.

isPuttingValueAsFirst bool

Whether to put value before key.

delimiter string

The delimiter to use.

Returns

string

The single line representation.

Type Parameters

Key

The key type.

Value

The value type.

DictionaryKeyValuePair<T1, T2>(string, IOrderedEnumerable<KeyValuePair<T1, T2>>)

Outputs an ordered dictionary of key-value pairs with a header.

void DictionaryKeyValuePair<T1, T2>(string header, IOrderedEnumerable<KeyValuePair<T1, T2>> ordered)

Parameters

header string

The header text.

ordered IOrderedEnumerable<KeyValuePair<T1, T2>>

The ordered key-value pairs.

Type Parameters

T1

The key type.

T2

The value type.

Dictionary<Header, Value>(Dictionary<Header, List<Value>>, bool)

Outputs a generic dictionary with headers and value lists.

void Dictionary<Header, Value>(Dictionary<Header, List<Value>> dictionary, bool isOnlyCountingInValue = false) where Header : IEnumerable<char>

Parameters

dictionary Dictionary<Header, List<Value>>

The dictionary to output.

isOnlyCountingInValue bool

Whether to only count values.

Type Parameters

Header

The header type implementing IEnumerable of char.

Value

The value type.

Dictionary<T1, T2>(Dictionary<T1, T2>, string)

Outputs a generic dictionary with custom delimiter.

void Dictionary<T1, T2>(Dictionary<T1, T2> dictionary, string delimiter = "|") where T1 : notnull

Parameters

dictionary Dictionary<T1, T2>

The dictionary to output.

delimiter string

The delimiter to use.

Type Parameters

T1

The key type.

T2

The value type.

EndRunTime()

Ends the runtime measurement.

void EndRunTime()

Header(string)

Outputs a header.

void Header(string header)

Parameters

header string

The header text.

List(IList<string>)

Outputs a list of strings.

void List(IList<string> list)

Parameters

list IList<string>

The list to output.

List(IList<string>, string)

Outputs a list of strings with a header.

void List(IList<string> list, string header)

Parameters

list IList<string>

The list to output.

header string

The header text.

ListObject(IList)

Outputs a non-generic list of objects.

void ListObject(IList list)

Parameters

list IList

The list to output.

ListSB(StringBuilder, string)

Outputs a StringBuilder as a list with a value.

void ListSB(StringBuilder stringBuilder, string value)

Parameters

stringBuilder StringBuilder

The StringBuilder to output.

value string

The value to append.

ListString(string, string)

Outputs a string list with a header.

void ListString(string text, string header)

Parameters

text string

The list string to output.

header string

The header text.

List<Value>(IList<Value>, string, string)

Outputs a generic list with custom delimiter.

void List<Value>(IList<Value> list, string delimiter = "\r\n", string whenNoEntries = "")

Parameters

list IList<Value>

The list to output.

delimiter string

The delimiter to use.

whenNoEntries string

Text to show when list is empty.

Type Parameters

Value

The value type.

List<Header, Value>(IList<Value>, Header)

Outputs a typed list with a generic header.

void List<Header, Value>(IList<Value> list, Header header) where Header : IEnumerable<char>

Parameters

list IList<Value>

The list to output.

header Header

The header.

Type Parameters

Header

The header type implementing IEnumerable of char.

Value

The value type.

List<Header, Value>(IList<Value>, Header, object)

Outputs a typed list with a generic header and generator arguments.

void List<Header, Value>(IList<Value> list, Header header, object textOutputGeneratorArgs) where Header : IEnumerable<char>

Parameters

list IList<Value>

The list to output.

header Header

The header.

textOutputGeneratorArgs object

Additional generator arguments.

Type Parameters

Header

The header type implementing IEnumerable of char.

Value

The value type.

NoData()

Outputs a "No data" message.

void NoData()

PairBullet(string, string)

Adds a bullet point with key-value pair.

void PairBullet(string key, string value)

Parameters

key string

The key.

value string

The value.

Paragraph(string, string)

Outputs a paragraph with a header.

void Paragraph(string text, string header)

Parameters

text string

The paragraph text.

header string

The header text.

Paragraph(StringBuilder, string)

Outputs a paragraph from StringBuilder with a header.

void Paragraph(StringBuilder stringBuilder, string header)

Parameters

stringBuilder StringBuilder

The paragraph content.

header string

The header text.

SingleCharLine(char, int)

Outputs a line of repeated characters.

void SingleCharLine(char paddingChar, int count)

Parameters

paddingChar char

The character to repeat.

count int

The number of times to repeat the character.

StartRunTime(string)

Starts runtime measurement with a description.

void StartRunTime(string text)

Parameters

text string

The description text.

ToString()

Converts the generated output to a string.

string ToString()

Returns

string

The generated output as a string.

Undo()

Undoes the last append operation.

void Undo()