Beispiel #1
0
 public override void BeginUpload(UploadEventArgs args)
 {
     args.UploadItem.SetResumeAction(this.ProcessUpload);
     args.BeginUpload();
     args.UploadProgressChanged(args.UploadItem.Length/2, new TimeSpan(0, 0, 0, 1));
     args.UploadCompleted(null);
 }
        public override void BeginUpload(UploadEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            try
            {
                _uploadEventArgs = args;
                _uploadEventArgs.UploadItem.SetResumeAction(ProcessUpload);
                _uploadStream = args.UploadItem.FileInfo.OpenRead();
                _uploadEventArgs.BeginUpload();
            }
            catch (Exception ex)
            {
                Exception = new UploadException("Response Callback Exception", ex);

                _uploadEventArgs.UploadCompleted(Exception);
            }
        }