Exemplo n.º 1
0
        public WebServiceQueueRequest CreateQueueRequest(object tag)
        {
            WebServiceQueueRequest serviceQueueRequest = new WebServiceQueueRequest(this.Url.ToString());

            serviceQueueRequest.Tag = tag;
            foreach (string allKey in this.Parameters.AllKeys)
            {
                serviceQueueRequest.Parameters.Add(allKey, this.Parameters[allKey]);
            }
            return(serviceQueueRequest);
        }
 private void Send()
 {
     if (this.Requests.Count > 0)
     {
         this.OnBeforeSend();
         this._currentRequest = this.Requests.Peek();
         this._webClient.UploadValuesAsync(this._currentRequest.Url, "POST", this._currentRequest.Parameters);
         this._timeoutCouter.Restart();
     }
     else
     {
         this._currentRequest = (WebServiceQueueRequest)null;
         this._intervalCouter.Restart();
     }
 }
 public WebServiceQueueRequestCompletedArgs(UploadValuesCompletedEventArgs args, WebServiceQueueRequest request)
 {
     this.Error          = args.Error;
     this.Cancelled      = args.Cancelled;
     this.Request        = request;
     this.DequeueRequest = true;
     if (this.Error == null && !this.Cancelled)
     {
         this.Result = WebService.GetStringFormResponseData(args.Result);
     }
     else
     {
         this.Result = string.Empty;
     }
 }