Пример #1
0
        //...

        protected virtual void OnExceptionUnhandled(UnhandledExceptions type, Exception e)
        {
            var error = new Error(e);

            _ = Dispatcher.BeginInvoke(() => Log.Write <BaseApplication>(error));
            ExceptionUnhandled?.Invoke(this, new UnhandledExceptionEventArgs(type, error));
        }
Пример #2
0
        private bool RunHandlerLevel(params IExecutableHandler[] levelHandlerList)
        {
            bool successfulExecution = true;

            foreach (IExecutableHandler handler in levelHandlerList)
            {
                try
                {
                    successfulExecution = handler.Execute(DataContext);
                }
                catch (QLBaseException ex)
                {
                    DataContext.ASTHandlerExceptions.Add(ex);
                    successfulExecution = false;
                }
                catch (Exception ex)
                {   //not known exception!
                    UnhandledExceptions.Add(ex);
                    successfulExecution = false;
                }

                if (!successfulExecution)
                {
                    break;
                }
            }
            return(successfulExecution);
        }
Пример #3
0
 public UnhandledExceptionEventArgs(UnhandledExceptions type, Error error) : base()
 {
     Type  = type;
     Error = error;
 }