Beispiel #1
0
        protected void OnError(AsyncHttpCallErrorEventArgs e)
        {
            var eh = this.Error;

            if (eh != null)
            {
                if (this.BeginInvoke == null)
                {
                    eh(this, e);
                }
                else
                {
                    this.BeginInvoke(() => eh(this, e));
                }
            }
        }
Beispiel #2
0
        private void GetResponseErrorCallback(AsyncHttpCallErrorEventArgs e, Action <HttpResponse> callback)
        {
            var ex = e.Exception as WebException;

            if (ex == null)
            {
                this.OnError(e);
                return;
            }
            var res = ex.Response as HttpWebResponse;

            if (res == null)
            {
                this.OnError(e);
                return;
            }
            this.GetResponseCallback(res, callback);
        }