aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Weinhold <gutmet@allfex.org>2016-06-11 10:15:54 +0200
committerAlexander Weinhold <gutmet@allfex.org>2016-06-11 10:15:54 +0200
commit9594422e68da68dcd308c236a26125feb843bc56 (patch)
treefee515a905dd0daeb6e13783ef9050db2f696bff
parentadd8080d82b8b9189bbb243ad9f08631101534b9 (diff)
downloadTDL-9594422e68da68dcd308c236a26125feb843bc56.tar.gz
driver program: set a min length for the plates column
-rw-r--r--TDL/TDL.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/TDL/TDL.cs b/TDL/TDL.cs
index 302473f..598edb2 100644
--- a/TDL/TDL.cs
+++ b/TDL/TDL.cs
@@ -116,8 +116,11 @@ namespace TDL
private IEnumerable<string> FormatLines(IEnumerable<Tuple<string, string, string>> line)
{
- int lengthFirstCol = line.Select(t => t.Item1.Length).Max();
+ int lengthFirstCol = Math.Max(line.Select(t => t.Item1.Length).Max(), 4);
int lengthSecondCol = line.Select(t => t.Item2.Length).Max();
+ int minLengthSecondCol = "Plates".Length;
+ if (lengthSecondCol > 0 && lengthSecondCol < minLengthSecondCol)
+ lengthSecondCol = minLengthSecondCol;
int lengthThirdCol = line.Select(t => t.Item3.Length).Max();
string formatString = "| {0, -" + lengthFirstCol + "} |"
+ (lengthSecondCol > 0? " {1, -" + lengthSecondCol +"} |" : string.Empty)