protected virtual void OnExecuteFailed(CommandExecuteFailedArgs e) { var handler = this.ExecuteFailed; if (handler != null) { handler(this, e); } }
/// <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; } }
/// <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; } } }
protected virtual void OnExecuteFailed(CommandExecuteFailedArgs e) { var handler = this.ExecuteFailed; if (handler != null) handler(this, e); }