예제 #1
0
        internal static void PrintHeading(string heading)
        {
            var headingStyle = GlobalViewStyle.Style.HeadingStyle;

            if (string.IsNullOrEmpty(heading))
            {
                return;
            }

            var decorationChar = Convert.ToChar(headingStyle.Decoration.Substring(0, 1));
            var indents        = 3;
            var headingLength  = heading.Length + 2;

            if (headingStyle.DecorationType == HeadingDecoration.Wrapped)
            {
                WriteLine(new string(decorationChar, headingLength + indents));
            }

            if (headingStyle.DecorationType == HeadingDecoration.Wrapped || headingStyle.DecorationType == HeadingDecoration.Indentation)
            {
                WriteLine($"{new string(decorationChar,  indents)} {heading}");
            }
            else
            {
                WriteLine($"{heading}");
            }

            if (headingStyle.DecorationType == HeadingDecoration.Wrapped || headingStyle.DecorationType == HeadingDecoration.Underlined)
            {
                WriteLine(new string(decorationChar, headingLength + indents));
            }

            ConzapTools.SkipLines(headingStyle.SkipLines);
        }
예제 #2
0
        internal static void PrintPostViewWait()
        {
            var style = GlobalViewStyle.Style;

            if (style.WaitMessage == "")
            {
                return;
            }

            if (style.WaitKey.HasValue && style.WaitMessage == null)
            {
                style.WaitMessage = $"Press {style.WaitKey.Value.ToString()} to continue...";
            }

            if (style.WaitMessage == null)
            {
                style.WaitMessage = "Press any key to continue...";
            }

            WriteLine(style.WaitMessage);

            if (style.WaitKey.HasValue)
            {
                ConzapTools.PauseForKey(style.WaitKey.Value);
            }
            else
            {
                ConzapTools.PauseForKey();
            }
        }
예제 #3
0
        internal static void WritePrompt(string writeLine)
        {
            if (string.IsNullOrEmpty(writeLine))
            {
                return;
            }

            ConzapTools.SkipLines(1);
            WriteLine(writeLine);
            Write(">>> ");
        }
예제 #4
0
 internal static void ClearScreen()
 {
     Console.Clear();
     ConzapTools.SkipLines(GlobalViewStyle.Style.TopPadding);
 }