Beispiel #1
0
        /// <summary>
        /// Start the upload by first checking for an item in the collection and starting the transmission
        /// </summary>
        private void BeginUpload()
        {
            if (Items.Count > 0)
            {
                _current = Items[0];
            }

            if (_current != null)
            {
                Busy      = true;
                _position = 0;

                Continue();
            }
            else
            {
                Complete = 100;

                if (Busy)
                {
                    RaiseUploadFinished(this, new UploadEventArgs("", Complete, _duration));
                }

                Busy = false;
            }
        }
Beispiel #2
0
        /// <summary>
        /// This is called when an item has been uploaded
        /// </summary>
        private void UploadItemComplete()
        {
            UploaderItem temp;

            if (_current.DataStream != null)
            {
                _current.DataStream.Close();
                _current.DataStream.Dispose();
            }

            temp     = _current;
            _current = null;

            RaiseUploadProgressChange(this, new UploadEventArgs(temp.FileName, Complete, _duration));
            RaiseUploadedItem(this, new UploadEventArgs(temp.FileName, Complete, _duration));
            _itemsUploaded++;

            Items.Remove(temp);

            BeginUpload();
        }