/// <summary> /// 执行命令 /// </summary> /// <param name = "args"></param> public static void Run(string[] args) { var commands = args == null ? "" : args.Aggregate(string.Empty, (current, arg) => current + (args + ";")); var invoke = true; // 标记 当前命令 是否执行 Reader = new IntelliSenseReader(CommandDic.Select(pair => pair.Key).ToList()); do { if (invoke) { Invoke(commands); } using (new ColorConsole(ConsoleColor.Yellow)) { commands = Reader.ReadLine(); } Console.Write("\r\n\r\n"); invoke = true; if (commands == "help") { Console.WriteLine(Help); invoke = false; } } while (commands != "exit"); Console.WriteLine("Goodbye!"); }
public static void ResetIntelliSense() { Reader = new IntelliSenseReader(CommandDic.Select(pair => pair.Key).ToList()); }