private void RaiseErrorEvent(NetworkErrorEventArgs e)
        {
            _logger.Trace("Raising Error event with message: {0}", e.Message);

            // make sure we only raise events on the correct context
            _synchronizationContext.Post(o =>
                                             {
                                                 var handlers = Error;
                                                 if (handlers != null)
                                                 {
                                                     var exception = new PhoneControllerException("Networking error: " + e.Message, e.Error, e.ErrorCode);
                                                     handlers(this, new ErrorEventArgs(exception));
                                                 }
                                             }, null);
        }
        private void RaiseErrorEvent(PhoneControllerException ex)
        {
            _logger.Trace("Raising Error event with message: {0}", ex.Message);

            // make sure we only raise events on the correct context
            _synchronizationContext.Post(o =>
            {
                var handlers = Error;
                if (handlers != null)
                {
                    handlers(this, new ErrorEventArgs(ex));
                }
            }, null);
        }
        private void RaiseErrorEvent(NetworkErrorEventArgs e)
        {
            _logger.Trace("Raising event Error");

            _synchronizationContext.Post(o =>
                                             {
                                                 var handlers = Error;
                                                 if (handlers != null)
                                                 {
                                                     var exception = new PhoneControllerException("Networking error: " + e.Message, e.Error, e.ErrorCode);
                                                     handlers(this, new ErrorEventArgs(exception));
                                                 }
                                             }, null);
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorEventArgs"/> class.
 /// </summary>
 /// <param name="error">The error to use.</param>
 public ErrorEventArgs(PhoneControllerException error)
 {
     Error = error;
 }