Пример #1
0
        private async Task FireEvent <TE>(IEventHandler <TE> handler, TE e, ICommand c) where TE : IEvent
        {
            try
            {
                if (DungeonGlobalConfiguration.EventTrace)
                {
                    loggerWrapper.BeforeEventInvoke(e, handler);
                }

                await handler.Handle(e, c);

                if (DungeonGlobalConfiguration.EventTrace)
                {
                    loggerWrapper.AfterEventInvoke(e, handler);
                }
            }
            catch (Exception ex)
            {
                if (DungeonGlobalConfiguration.EventTrace)
                {
                    loggerWrapper.OnEventInvokeError(e, handler, ex);
                }

                loggerWrapper.Error(ex.ToString());
            }
        }