Exemplo n.º 1
0
 public void TriggerInstantly <TEventArgs>(EventHandler <TEventArgs> handler, object source, TEventArgs args) where TEventArgs : EventArgs
 {
     eventMarshaller.Marshal(() =>
     {
         try
         {
             handler?.Invoke(source, args);
         }
         catch (Exception exception)
         {
             logger.Log(LogLevel.Error,
                        "EventMarshaller has thrown an unhandled exception on instant handler invocation", this,
                        exception);
         }
     });
 }
        void OnOperationFaulted(ExceptionEventArgs e)
        {
            var handler = OperationError;

            if (handler != null)
            {
                if (eventMarshaller != null)
                {
                    eventMarshaller.Marshal(() =>
                    {
                        handler(this, e);
                    });
                }
                else
                {
                    handler(this, e);
                }
            }
        }