Ejemplo n.º 1
0
 private string GetLineForASCIITable(ASCIITable tableOutputType, int[] columnLengths, int lineNumber)
 {
     string[] content = new string[columnLengths.Length];
     for (int column = 0; column < this.Array.GetLength(1); column++)
     {
         content[column] = this.Array[lineNumber, column];
     }
     return(this.GetLine(tableOutputType.Characters.VerticalLineCharacter, content, ' ', tableOutputType.Characters.VerticalLineCharacter, tableOutputType.Characters.VerticalLineCharacter, columnLengths));
 }
Ejemplo n.º 2
0
            public string[] Handle(ASCIITable tableOutputType)
            {
                List <string> result = new();

                if (!string.IsNullOrEmpty(tableOutputType.Title))
                {
                    result.Add(tableOutputType.Title);
                }
                int[] columnLengths = this.GetColumnLengths(this.Array, tableOutputType.MaximalWidth);
                result.Add(this.GetFirstLineForASCIITable(tableOutputType, columnLengths));
                result.Add(this.GetHeadlineLineForASCIITable(tableOutputType, columnLengths));
                if (tableOutputType.TableHasTitles)
                {
                    result.Add(this.GetHeadlineDividerLineForASCIITable(tableOutputType, columnLengths));
                }
                for (int lineNumber = 1; lineNumber < this.Array.GetLength(0); lineNumber++)
                {
                    result.Add(this.GetLineForASCIITable(tableOutputType, columnLengths, lineNumber));
                }
                result.Add(this.GetLastLineForASCIITable(tableOutputType, columnLengths));
                return(result.ToArray());
            }
Ejemplo n.º 3
0
 private string GetFirstLineForASCIITable(ASCIITable tableOutputType, int[] columnLengths)
 {
     return(this.GetLine(tableOutputType.Characters.LeftUpperCornerCharacter, this.NTimes(tableOutputType.Characters.HorizontalLineCharacter.ToString(), columnLengths.Length), tableOutputType.Characters.HorizontalLineCharacter, tableOutputType.Characters.TDownCharacter, tableOutputType.Characters.RightUpperCornerCharacter, columnLengths));
 }
Ejemplo n.º 4
0
 private string GetHeadlineLineForASCIITable(ASCIITable tableOutputType, int[] columnLengths)
 {
     return(this.GetLineForASCIITable(tableOutputType, columnLengths, 0));
 }
Ejemplo n.º 5
0
 private string GetHeadlineDividerLineForASCIITable(ASCIITable tableOutputType, int[] columnLengths)
 {
     return(this.GetLine(tableOutputType.Characters.TRightCharacter, this.NTimes(tableOutputType.Characters.HorizontalLineCharacter.ToString(), columnLengths.Length), tableOutputType.Characters.HorizontalLineCharacter, tableOutputType.Characters.CrossCharacter, tableOutputType.Characters.TLeftCharacter, columnLengths));
 }