Esempio n. 1
0
        /// <summary>
        /// This is called when a packet of data has been sucessfully received on the server
        /// </summary>
        /// <param name="e">Event arguments</param>
        private void CommandComplete(HttpResponseCompleteEventArgs e)
        {
            _serverResponse = e.Response;

            if (!_aborted && e.Response.Contains("ok"))
            {
                _totalUploaded += _count;
                _position      += _count;

                Complete = ((double)_totalUploaded / (double)_totalUploadSize) * 100;
                RaiseUploadProgressChange(this, new UploadEventArgs(_current.FileName, Complete, _duration));

                if (_position < _current.Length)
                {
                    if (!IsPaused)
                    {
                        Continue();
                    }
                    else
                    {
                        _uploadPaused = true;
                    }
                }
                else
                {
                    UploadItemComplete();
                }
            }
            else
            {
                AbortUploadItem();

                if (_aborted)
                {
                    Reset();
                }
            }
        }
Esempio n. 2
0
 private void OnResponseComplete(HttpResponseCompleteEventArgs e)
 {
     responseEventArgs = e;
     _completed        = true;
 }