Esempio n. 1
0
        private List <string> FormatTextToBread(List <string> lines)
        {
            var max     = lines.Max(x => x.Length);
            var maxLine = max + 5;

            var outputLines = new List <string>();

            var headerBorder = new BorderedLine
            {
                Left  = " .",
                Right = ". ",
                Fill  = '-'
            };
            var standardBorder = new BorderedLine
            {
                Left  = "| ",
                Right = " |",
                Fill  = ' '
            };
            var footerBorder = new BorderedLine
            {
                Left  = "|",
                Right = "|",
                Fill  = '_'
            };

            outputLines.Add(headerBorder.FillToWidth(maxLine - 1));
            outputLines.AddRange(lines.Select(line => standardBorder.SurroundToWidth(line.ToUpper(), max)));
            outputLines.Add(footerBorder.FillToWidth(maxLine - 1));

            return(outputLines);
        }
Esempio n. 2
0
        private List <string> FormatTextToHeadstone(List <string> lines)
        {
            var max     = lines.Max(x => x.Length);
            var maxLine = max + 6;

            var outputLines = new List <string>();

            var headerBorder = new BorderedLine
            {
                Left  = "  _.",
                Right = "._ ",
                Fill  = '-'
            };
            var standardBorder = new BorderedLine
            {
                Left  = " | ",
                Right = " |",
                Fill  = ' '
            };
            var footerBorder = new BorderedLine
            {
                Left  = " |",
                Right = "|",
                Fill  = '_'
            };
            var baseBorder = new BorderedLine
            {
                Left  = "|",
                Right = "|",
                Fill  = '_'
            };

            outputLines.Add(headerBorder.FillToWidth(maxLine - 1)); // - 1 cause we want it to end 1 char early
            outputLines.Add(standardBorder.SurroundToWidth("RIP", max));

            outputLines.AddRange(lines.Select(line => standardBorder.SurroundToWidth(line.ToUpper(), max)));

            outputLines.Add(footerBorder.FillToWidth(maxLine - 1));
            outputLines.Add(baseBorder.FillToWidth(maxLine));

            return(outputLines);
        }