コード例 #1
0
 private void InvokeExecuting(CancelCommandEventArgs args)
 {
     if (Executing != null)
     {
         Executing(this, args);
     }
 }
コード例 #2
0
        public void DoExecute(object param)
        {
            CancelCommandEventArgs args = new CancelCommandEventArgs()
            {
                Parameter = param, Cancel = false
            };

            InvokeExecuting(args);

            if (args.Cancel)
            {
                return;
            }

            InvokeAction(param);

            InvokeExecuted(new CommandEventArgs()
            {
                Parameter = param
            });
        }