public void Execute(object parameter)
            {
                var args = new ConfirmedCommandEventArgs { Parameter = parameter };

                _owner.QueryCancelExecution(args);

                if (args.Cancel)
                    return;

                try
                {
                    _command.Execute(args.Parameter);
                }
                catch (Exception ex)
                {
                    _owner.OnError(new ErrorEventArgs(ex));
                }
            }
            public void Execute([CanBeNull] object parameter)
            {
                var args = new ConfirmedCommandEventArgs {
                    Parameter = parameter
                };

                _owner.QueryCancelExecution(args);

                if (args.Cancel)
                {
                    return;
                }

                try
                {
                    _command.Execute(args.Parameter);
                }
                catch (Exception ex)
                {
                    _owner.OnError(new ErrorEventArgs(ex));
                }
            }
 private void QueryCancelExecution([NotNull] ConfirmedCommandEventArgs e)
 {
     Executing?.Invoke(this, e);
 }
Exemple #4
0
        private void QueryCancelExecution([NotNull] ConfirmedCommandEventArgs e)
        {
            Contract.Requires(e != null);

            Executing?.Invoke(this, e);
        }