Beispiel #1
0
        /// <summary>
        /// Process the response callback from a POX method call.
        /// </summary>
        /// <param name="ar">The async result object.</param>
        private void ResponseCallback(IAsyncResult ar)
        {
            RequestData            data     = (RequestData)ar.AsyncState;
            HttpWebRequest         request  = data.Request;
            HttpWebResponse        response = (HttpWebResponse)request.EndGetResponse(ar);
            Action <ServiceResult> callback = data.Callback;
            WebServiceResult       wsr      = data.ConvertToResult(response);

            wsr.ReadHttpWebResponse();

            _sync.Post(UserInterfaceThreadCallback, new CrossThreadState(callback, wsr));
        }
 /// <summary>
 /// Initializes a new TemporaryStateObject object.
 /// </summary>
 /// <param name="callback">The callback action.</param>
 /// <param name="result">The result object.</param>
 public CrossThreadState(Action <ServiceResult> callback, WebServiceResult result)
 {
     Callback = callback;
     Result   = result;
 }
 /// <summary>
 /// Initializes a new TemporaryStateObject object.
 /// </summary>
 /// <param name="callback">The callback action.</param>
 /// <param name="result">The result object.</param>
 public CrossThreadState(Action<ServiceResult> callback, WebServiceResult result)
 {
     Callback = callback;
     Result = result;
 }