Class TextOutputGeneratorStatic
- Namespace
- SunamoTextOutputGenerator
- Assembly
- SunamoTextOutputGenerator.dll
Static helper methods for generating text output from collections and dictionaries.
public class TextOutputGeneratorStatic
- Inheritance
-
TextOutputGeneratorStatic
- Inherited Members
- Extension Methods
Methods
CompareList(List<string>, string, List<string>, string, List<string>)
Compares two lists and outputs them with headers showing which items are in both, first only, or second only.
public static string CompareList(List<string> both, string firstHeader, List<string> firstList, string secondHeader, List<string> secondList)
Parameters
bothList<string>Items present in both lists.
firstHeaderstringHeader for the first list.
firstListList<string>The first list of items.
secondHeaderstringHeader for the second list.
secondListList<string>The second list of items.
Returns
- string
Formatted text output comparing the lists.
Dictionary(Dictionary<string, string>)
Outputs a string-string dictionary as formatted text.
public static string Dictionary(Dictionary<string, string> dictionary)
Parameters
dictionaryDictionary<string, string>The dictionary to output.
Returns
- string
Formatted text output of the dictionary.
DictionaryWithCount<TKey, TValue>(Dictionary<TKey, List<TValue>>)
Outputs a dictionary with list values, showing each list under its key as header.
public static string DictionaryWithCount<TKey, TValue>(Dictionary<TKey, List<TValue>> dictionary) where TKey : notnull
Parameters
dictionaryDictionary<TKey, List<TValue>>The dictionary to output.
Returns
- string
Formatted text output of the dictionary with counts.
Type Parameters
TKeyThe type of the key.
TValueThe type of the list elements.