protected override void Dispose(bool disposing)
        {
            base.Dispose (disposing);

            if (this.pickerController != null) {
                this.pickerController.Dispose ();
                this.pickerController = null;
            }
            if (this.uploader != null) {
                this.uploader.Dispose ();
                this.uploader = null;
            }
            this.ReleaseDesignerOutlets ();
        }
        private void StartUpload()
        {
            this.uploader = new Uploader ("http://ever-development.elasticbeanstalk.com/api/1/admin/upload_test");
            this.uploader.OnProgressChanged += this.HandleProgressChanged;

            this.uploader.DataToUpload = this.toUploadData;
            this.uploader.UploadAsync (delegate(string response, Exception thrownException) {
                this.BeginInvokeOnMainThread(delegate {
                    this.HandleUploadEnded(response, thrownException);
                });
            });
            this.ConfigureAsStopUploading();
        }
 private void HandleProgressChanged(Uploader uploader)
 {
     this.BeginInvokeOnMainThread (delegate {
         this.SetProgressRatio(uploader.UploadedRatio);
     });
 }
        private void HandleUploadEnded(string response, Exception thrownException)
        {
            string message = null;

            if (thrownException == null) {
                message = "The upload succeed: " + response;
            } else {
                message = "The upload failed: " + thrownException.Message;
                Console.WriteLine (thrownException.StackTrace);

            }
            UIAlertView alertView = new UIAlertView ("Upload finished", message, null, "OK");
            alertView.Show ();
            this.uploader = null;
            this.ConfigureAsStartUploading ();
        }
Esempio n. 5
0
 private void HandleProgressChanged(Uploader uploader)
 {
     this.BeginInvokeOnMainThread(delegate {
         this.SetProgressRatio(uploader.UploadedRatio);
     });
 }