示例#1
0
 private IEnumerator <object> ExecuteTask(Func <string> action)
 {
     yield return(OrangeActionsHelper.ExecuteOrangeAction(action, () => {
         The.Workspace.Save();
         EnableControls(false);
         textView.Clear();
     }, () => {
         EnableControls(true);
         The.UI.ScrollLogToEnd();
     }, DoesNeedSvnUpdate,
                                                          Task.ExecuteAsync
                                                          ));
 }
示例#2
0
        private void RunCommand(string command)
        {
            if (command == null)
            {
                WriteHelpAndExit();
            }
            var commands   = The.MenuController.GetVisibleAndSortedItems();
            var commandObj = commands.Find(i => i.Label == command);

            if (commandObj == null)
            {
                Console.WriteLine("Unknown command: '{0}'", command);
                WriteHelpAndExit();
                return;
            }

            OrangeActionsHelper.ExecuteOrangeActionInstantly(commandObj.Action, () => { }, () => { }, null);
        }