예제 #1
0
        public static void RunBatchCommands(IEnumerable <string> consoleInputs)
        {
            foreach (var consoleInput in consoleInputs)
            {
                var msg = string.Format(ConsoleFormatting.Indent(2) + "{0} {1}", ReadPrompt, consoleInput);
                WriteToConsole(msg);

                if (ProcessInputRunner(consoleInput))
                {
                    return;
                }
            }
        }
예제 #2
0
        static string BuildHelpMessage(string library = null)
        {
            var sb = new StringBuilder("Commands: ");

            sb.AppendLine();
            foreach (var item in CommandLibrary.Content)
            {
                if (library != null && item.Key != library)
                {
                    continue;
                }
                foreach (var cmd in item.Value.MethodDictionary)
                {
                    sb.Append(ConsoleFormatting.Indent(1));
                    sb.Append(item.Key);
                    sb.Append(".");
                    sb.Append(cmd.Key);
                    sb.AppendLine();
                }
            }
            return(sb.ToString());
        }