Пример #1
0
        private string BuildFullRow(string title, string definition)
        {
            title = ConsoleBasicDraw.RepresentObjectAsString(title, titleWidth);
            string paddingFillString = this.BuildPaddingFillString(title, definition);

            return(String.Concat(title, paddingFillString, definition));
        }
Пример #2
0
 public static void DrawFlatText(string message, int topMargin,
                                 ConsoleColor background, ConsoleColor foreground)
 {
     ConsoleBasicDraw.FillRow(topMargin, background);
     message = ConsoleBasicDraw.RepresentObjectAsString(message, Console.WindowWidth);
     ConsoleBasicDraw.DrawText(message, 1, topMargin, background, foreground);
 }
Пример #3
0
        private void DrawElement(int index)
        {
            int    lineNumber = index + this.TopMargin;
            string text       = this.Values[index];

            ConsoleBasicDraw.DrawFlatText(text, lineNumber, this.Background,
                                          this.Foreground);
        }
Пример #4
0
        private void DrawSelectedElement(int prevIndex)
        {
            this.DrawElement(prevIndex);
            string text       = this.Values[this.SelectedIndex];
            int    lineNumber = this.SelectedIndex + this.TopMargin;

            ConsoleBasicDraw.DrawFlatText(text, lineNumber, this.Foreground,
                                          this.Background);
        }
Пример #5
0
        public static void DrawFlatBox(int topMargin, int height, ConsoleColor background)
        {
            int lastRow = height + topMargin + 1;

            for (int row = topMargin + 1; row < lastRow; row++)
            {
                ConsoleBasicDraw.FillRow(row, background);
            }
        }
Пример #6
0
        public void Draw(string title, params string[] arguments)
        {
            string definition = this.BuildDefinitionValue(arguments);
            string message    = this.BuildFullRow(title, definition);

            ConsoleBasicDraw.DrawFlatText(message, this.currentLine,
                                          ConsoleColor.White, ConsoleColor.Black);

            this.currentLine++;
        }
Пример #7
0
        private string BuildDefinitionValue(params string[] arguments)
        {
            string definition = String.Join(", ", arguments);

            return(ConsoleBasicDraw.RepresentObjectAsString(definition, definitionWidth));
        }