コード例 #1
0
 private void Execute(CliCommand cliCommand, Cmd cmd)
 {
     try
     {
         cliCommand.Execute(cmd);
     }
     catch (ArgumentError e)
     {
         clti.WriteError(e.Message);
         clti.WriteError(cliCommand.Help);
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            if (args == null ||
                args.Length == 0)
            {
                return;
            }

            string     typeName   = string.Format("ConcurrentProgramming.CLI.{0}CliCommand", args[0]);
            CliCommand cliCommand = (CliCommand)Activator.CreateInstance(Type.GetType(typeName));

            cliCommand.Execute(args);

            Console.Read();
        }