示例#1
0
 private static void RunWorker(CommandList cmdList)
 {
     try {
         cmdList.Run();
     }
     catch (ThreadAbortException) {
         UO.PrintInformation("Command execution terminated.");
     }
     catch (ScriptErrorException e) {
         Trace.WriteLine("Unhandled exception:\n" + e.ToString(), "Script");
         UO.PrintError(e.Message);
     }
     catch (Exception e) {
         Trace.WriteLine("Unhandled error during command execution. Exception:" + Environment.NewLine + e.ToString(), "Runtime");
         UO.PrintError("Command error: {0}", e.Message);
     }
 }
示例#2
0
 private void Run()
 {
     CommandList cl = new CommandList(commandBox.Text);
     ThreadStarter.StartBackround(new RunWorkerDelegate(RunWorker), cl);
 }