예제 #1
0
        protected virtual void OnExecuteFailed(CommandExecuteFailedArgs e)
        {
            var handler = this.ExecuteFailed;

            if (handler != null)
            {
                handler(this, e);
            }
        }
예제 #2
0
 /// <summary>
 /// 执行这个命令
 /// </summary>
 /// <param name="param"></param>
 public void Execute(object param)
 {
     try
     {
         this.ExecuteCore(param);
         this.OnExecuted();
     }
     catch (Exception ex)
     {
         var args = new CommandExecuteFailedArgs(ex, param);
         this.OnExecuteFailed(args);
         if (!args.Cancel) throw;
     }
 }
예제 #3
0
 /// <summary>
 /// 执行这个命令
 /// </summary>
 /// <param name="param"></param>
 public void Execute(object param)
 {
     try
     {
         this.ExecuteCore(param);
         this.OnExecuted();
     }
     catch (Exception ex)
     {
         var args = new CommandExecuteFailedArgs(ex, param);
         this.OnExecuteFailed(args);
         if (!args.Cancel)
         {
             throw;
         }
     }
 }
예제 #4
0
 protected virtual void OnExecuteFailed(CommandExecuteFailedArgs e)
 {
     var handler = this.ExecuteFailed;
     if (handler != null) handler(this, e);
 }