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
Methods
Append(string)
Appends text to the output.
void Append(string text)
Parameters
textstringThe text to append.
AppendFormat(string, params string[])
Appends formatted text to the output.
void AppendFormat(string text, params string[] parameters)
Parameters
AppendLine()
Appends a new line to the output.
void AppendLine()
AppendLine(string)
Appends text followed by a new line.
void AppendLine(string text)
Parameters
textstringThe text to append.
AppendLine(StringBuilder)
Appends a StringBuilder's content followed by a new line.
void AppendLine(StringBuilder stringBuilder)
Parameters
stringBuilderStringBuilderThe StringBuilder to append.
AppendLineFormat(string, params string[])
Appends formatted text followed by a new line.
void AppendLineFormat(string text, params string[] parameters)
Parameters
CountEvery<T>(IList<KeyValuePair<T, int>>)
Outputs count of every item in the list.
void CountEvery<T>(IList<KeyValuePair<T, int>> list)
Parameters
listIList<KeyValuePair<T, int>>The items with their counts.
Type Parameters
TThe 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
dictionaryDictionary<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
dictionaryDictionary<string, int>The dictionary to output.
delimiterstringThe delimiter to use.
Dictionary(Dictionary<string, string>)
Outputs a dictionary of string keys to string values.
void Dictionary(Dictionary<string, string> dictionary)
Parameters
dictionaryDictionary<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
dictionaryDictionary<Key, Value>The dictionary to convert.
isPuttingValueAsFirstboolWhether to put value before key.
delimiterstringThe delimiter to use.
Returns
- string
The single line representation.
Type Parameters
KeyThe key type.
ValueThe 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
headerstringThe header text.
orderedIOrderedEnumerable<KeyValuePair<T1, T2>>The ordered key-value pairs.
Type Parameters
T1The key type.
T2The 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
dictionaryDictionary<Header, List<Value>>The dictionary to output.
isOnlyCountingInValueboolWhether to only count values.
Type Parameters
HeaderThe header type implementing IEnumerable of char.
ValueThe 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
dictionaryDictionary<T1, T2>The dictionary to output.
delimiterstringThe delimiter to use.
Type Parameters
T1The key type.
T2The value type.
EndRunTime()
Ends the runtime measurement.
void EndRunTime()
Header(string)
Outputs a header.
void Header(string header)
Parameters
headerstringThe header text.
List(IList<string>)
Outputs a list of strings.
void List(IList<string> list)
Parameters
List(IList<string>, string)
Outputs a list of strings with a header.
void List(IList<string> list, string header)
Parameters
ListObject(IList)
Outputs a non-generic list of objects.
void ListObject(IList list)
Parameters
listIListThe list to output.
ListSB(StringBuilder, string)
Outputs a StringBuilder as a list with a value.
void ListSB(StringBuilder stringBuilder, string value)
Parameters
stringBuilderStringBuilderThe StringBuilder to output.
valuestringThe value to append.
ListString(string, string)
Outputs a string list with a header.
void ListString(string text, string header)
Parameters
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
listIList<Value>The list to output.
delimiterstringThe delimiter to use.
whenNoEntriesstringText to show when list is empty.
Type Parameters
ValueThe 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
listIList<Value>The list to output.
headerHeaderThe header.
Type Parameters
HeaderThe header type implementing IEnumerable of char.
ValueThe 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
listIList<Value>The list to output.
headerHeaderThe header.
textOutputGeneratorArgsobjectAdditional generator arguments.
Type Parameters
HeaderThe header type implementing IEnumerable of char.
ValueThe 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
Paragraph(string, string)
Outputs a paragraph with a header.
void Paragraph(string text, string header)
Parameters
Paragraph(StringBuilder, string)
Outputs a paragraph from StringBuilder with a header.
void Paragraph(StringBuilder stringBuilder, string header)
Parameters
stringBuilderStringBuilderThe paragraph content.
headerstringThe header text.
SingleCharLine(char, int)
Outputs a line of repeated characters.
void SingleCharLine(char paddingChar, int count)
Parameters
StartRunTime(string)
Starts runtime measurement with a description.
void StartRunTime(string text)
Parameters
textstringThe 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()