Esempio n. 1
0
        private static string GetRight(HorizontalBorderType borderType)
        {
            switch (borderType)
            {
            case HorizontalBorderType.Top:
                return("╗");

            case HorizontalBorderType.Mid:
                return("╣");

            case HorizontalBorderType.Bottom:
                return("╝");

            default:
                return("╢");
            }
        }
Esempio n. 2
0
        private static string GetMidMain(HorizontalBorderType borderType)
        {
            switch (borderType)
            {
            case HorizontalBorderType.Top:
                return("╦");

            case HorizontalBorderType.Mid:
                return("╬");

            case HorizontalBorderType.Bottom:
                return("╩");

            default:
                return("╫");
            }
        }
Esempio n. 3
0
        private static string GetLeft(HorizontalBorderType borderType)
        {
            switch (borderType)
            {
            case HorizontalBorderType.Top:
                return("╔");

            case HorizontalBorderType.Mid:
                return("╠");

            case HorizontalBorderType.Bottom:
                return("╚");

            default:
                return("╟");
            }
        }
Esempio n. 4
0
        private static string GetMid(HorizontalBorderType borderType)
        {
            switch (borderType)
            {
            case HorizontalBorderType.Top:
                return("╤");

            case HorizontalBorderType.Mid:
                return("╪");

            case HorizontalBorderType.Bottom:
                return("╧");

            default:
                return("┼");
            }
        }
Esempio n. 5
0
        private static string GenerateHorizontalBorder(int sudokuSize, int sudokuRegionSize, HorizontalBorderType borderType)
        {
            int    nrDigits         = sudokuSize.ToString().Length + 1;
            string doubleHorizontal = new string(borderType == HorizontalBorderType.Intermed ? '─' : '═', sudokuRegionSize *nrDigits);

            StringBuilder horizontalBorder = new StringBuilder();

            horizontalBorder.Append(GetLeft(borderType));

            for (int i = 0; i < sudokuSize; i++)
            {
                horizontalBorder.Append(doubleHorizontal);

                if (i < sudokuSize - 1)
                {
                    if ((i + 1) % sudokuRegionSize == 0)
                    {
                        horizontalBorder.Append(GetMidMain(borderType));
                    }
                    else
                    {
                        horizontalBorder.Append(GetMid(borderType));
                    }
                }
            }

            horizontalBorder.Append(GetRight(borderType));
            return(horizontalBorder.ToString());
        }