示例#1
0
        private static void Encase(bool isHeader, string splitter, int maxLength)
        {
            var loop = 1;

            while (loop <= 3)
            {
                if (isHeader && loop == 3 || !isHeader && loop == 1)
                {
                    Console.WriteLine("{0,2} {1,0} {2, " + (maxLength - 2) + "}", splitter.Repeat(2), "", splitter.Repeat(2));
                }
                else
                {
                    ConsoleX.WriteSplitter(splitter, maxLength + 2);
                }
                loop++;
            }
        }
示例#2
0
        /// <summary>
        /// executes the help command for the current command handler <see cref="CommandHandler"/>
        /// </summary>
        public static void WriteHelp(string arg)
        {
            if (arg == string.Empty)
            {
                System.Console.WriteLine("{0,-20} {1,-20} {2,10}", "Short Name", "Long Name", "Description");

                ConsoleX.WriteSplitter("-", 100);

                foreach (var commandProp in Handler.GetAllCommandsProperties())
                {
                    System.Console.WriteLine("-{0,-20} -{1,-20} {2,10}", commandProp.Command.ShortName, commandProp.Command.LongName,
                                             commandProp.Command.Description);
                }

                ConsoleX.WriteSplitter("-", 100);
            }
            else
            {
                WriteCommandHelp(arg);
            }
        }