Exemple #1
0
        protected override void RegisterCommandHandlers()
        {
            Commands.EXECUTOR_ERROR.Handler += delegate(object sender, EventArgs e)
            {
                ExecutorCommandEventArgs args = (ExecutorCommandEventArgs)e;
                int errorCode = args.Command.GetArgumentValue <int>("errorCode");

                switch (errorCode)
                {
                default:
                    break;

                case (int)Commands.ErrorCode.NAME_ALREADY_IN_USE:
                    DidSendRegister = false;
                    break;
                }

                if (OnError != null)
                {
                    OnError(this, args);
                }
            };
            Commands.EXECUTOR_CONTROL_PLAN_CANCEL.Handler += delegate(object sender, EventArgs e)
            {
                if (OnControlPlanCancel != null)
                {
                    OnControlPlanCancel(this, (ExecutorCommandEventArgs)e);
                }
            };
        }
Exemple #2
0
        private void OnControlPlanCancel(object sender, ExecutorCommandEventArgs e)
        {
            if (RunningOperation == null || !RunningOperation.IsRunning)
            {
                Handler.Send(Commands.ReportError(0, "Can't cancel. Operation is not running"));
                return;
            }

            RunningOperation.Cancel();
        }
Exemple #3
0
        private void OnErrorReceived(object sender, ExecutorCommandEventArgs e)
        {
            string message = e.Command.GetArgumentValue <string>("message");

            logger.Warn("ERROR RECEIVED: {0}", message);
        }