コード例 #1
0
        protected bool OnFailed(CommandExecutorContext context, Exception ex)
        {
            var args = new CommandExecutorFailureEventArgs(context, ex);

            //激发“Failed”事件
            this.OnFailed(args);

            //输出异常信息
            if (!args.ExceptionHandled && args.Exception != null)
            {
                this.Error.WriteLine(args.Exception);
            }

            return(args.ExceptionHandled);
        }
コード例 #2
0
 protected virtual void OnFailed(CommandExecutorFailureEventArgs args)
 {
     this.Failed?.Invoke(this, args);
 }