示例#1
0
        /// <summary>
        /// Execute cmd
        /// </summary>
        private void ExecuteCmd(string command)
        {
            if (!_internalCommand.ProcessInternalCommand(command))
            {
                try
                {
                    _host.Ui.ShowMsgInStatusBar("Executing...", true);

                    if (_shellCmder != null)
                    {
                        CmdResult cmdResult = _shellCmder.ExecuteCmd("", command, _currentDir, _isWin);
                        //设置当前目录
                        _currentDir = cmdResult.CurrentDir;
                        //设置提示信息
                        _consoleBoxCmder.Prompt = _currentDir;
                        _consoleBoxCmder.PrintCommandResult(cmdResult.Result);
                        _host.Ui.ShowMsgInStatusBar("Execute success", false);
                    }
                }
                catch (Exception ex)
                {
                    _consoleBoxCmder.PrintCommandResult("[Error]:" + ex.Message);
                    _host.Ui.ShowMsgInStatusBar("Execute failed", false);
                }
            }
        }
示例#2
0
 /// <summary>
 /// Execute cmd
 /// </summary>
 private void ExecuteCmd(string command)
 {
     if (!_internalCommand.ProcessInternalCommand(command))
     {
         try
         {
             if (_shellCmder != null)
             {
                 CmdResult cmdResult = _shellCmder.ExecuteCmd("", command, _currentDir, _isWin);
                 //设置当前目录
                 _currentDir = cmdResult.CurrentDir;
                 //设置提示信息
                 _consoleBoxCmder.Prompt = _currentDir;
                 _consoleBoxCmder.PrintCommandResult(cmdResult.Result);
             }
         }
         catch (Exception ex)
         {
             _consoleBoxCmder.PrintCommandResult("[Error]:" + ex.Message);
         }
     }
 }