| 1 |
using System.Collections.Generic; |
| 2 |
using System.Text; |
| 3 |
|
| 4 |
namespace Mono.Documentation.Updater.Statistics |
| 5 |
{ |
| 6 |
public static class StatisticsFormatter |
| 7 |
{ |
| 8 |
public static string Format(Dictionary<string, StatisticsStorage> input) |
| 9 |
{ |
| 10 |
var result = new StringBuilder(); |
| 11 |
foreach (var statisticsStoragePair in input) |
| 12 |
{ |
| 13 |
var framework = statisticsStoragePair.Key; |
| 14 |
var statisticsStorage = statisticsStoragePair.Value; |
| 15 |
result.AppendLine($"Framework: {framework}"); |
| 16 |
result.AppendLine("--------"); |
| 17 |
foreach (var statistics in statisticsStorage.Values) |
| 18 |
{ |
| 19 |
var staticsItem = statistics.Key; |
| 20 |
foreach (var statisticsValuePair in statistics.Value) |
| 21 |
{ |
| 22 |
result.AppendLine($"{staticsItem} {statisticsValuePair.Key}: {statisticsValuePair.Value}"); |
| 23 |
} |
| 24 |
result.AppendLine(); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
return result.ToString(); |
| 29 |
} |
| 30 |
} |
| 31 |
} |