Esempio n. 1
0
        private ProcessResult _runSingleCommand(SimpleCommand command)
        {
            Cursor         = Cursors.WaitCursor;
            cmdOutput.Text = "";
            LockControls();

            try
            {
                var result = command.Invoke();
                cmdOutput.Text += result.Output;
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Error(string.Format("Exception while executing the command {0}", command.Method.Name), ex);
                MessageBox.Show(Resources.MainForm_UnhandledException + ": " + ex.Message, Resources.MainForm_Error);
                return(ProcessResult.Of(ex));
            }
            finally
            {
                Cursor = DefaultCursor;
                UnlockControls();
            }
        }