Beispiel #1
0
        private void Upload()
        {
            if (null == connection)
            {
                Log.DebugFormat("No connection");
            }

            Picture [] pictures = GetPicturesForUpload();

            FSpotUploadProgress fup = new FSpotUploadProgress(
                pictures, progress_dialog);

            connection.UploadProgressHandler += fup.HandleProgress;

            ServicePointManager.CertificatePolicy =
                new UserDecisionCertificatePolicy();

            try {
                foreach (Picture picture in pictures)
                {
                    picture.Upload(connection);
                }

                progress_dialog.Message = Catalog.GetString(
                    "Done sending photos");
                progress_dialog.ProgressText = Catalog
                                               .GetString("Upload complete");
                progress_dialog.Fraction    = 1;
                progress_dialog.ButtonLabel = Gtk.Stock.Ok;
            } catch (TabbloException e) {
                progress_dialog.Message = Catalog.GetString(
                    "Error uploading to Tabblo: ")
                                          + e.Message;
                progress_dialog.ProgressText =
                    Catalog.GetString("Error");
                // FIXME:  Retry logic?
//				  progressDialog.PerformRetrySkip ();
                Log.DebugFormat("Error uploading:\n" + e);
            } finally {
                connection.UploadProgressHandler -=
                    fup.HandleProgress;
            }
        }
		private void Upload ()
		{
			if (null == connection) Log.DebugFormat ("No connection");

			Picture [] pictures = GetPicturesForUpload ();

			FSpotUploadProgress fup = new FSpotUploadProgress (
					pictures, progress_dialog);
			connection.UploadProgressHandler += fup.HandleProgress;

			ServicePointManager.CertificatePolicy =
					new UserDecisionCertificatePolicy ();

			try {
				foreach (Picture picture in pictures) {
					picture.Upload (connection);
				}

				progress_dialog.Message = Catalog.GetString (
						"Done sending photos");
				progress_dialog.ProgressText = Catalog
						.GetString ("Upload complete");
				progress_dialog.Fraction = 1;
				progress_dialog.ButtonLabel = Gtk.Stock.Ok;

			} catch (TabbloException e) {
				progress_dialog.Message = Catalog.GetString (
						"Error uploading to Tabblo: ")
						+ e.Message;
				progress_dialog.ProgressText =
						Catalog.GetString ("Error");
				// FIXME:  Retry logic?
//				  progressDialog.PerformRetrySkip ();
				Log.DebugFormat ("Error uploading:\n" + e);
			} finally {
				connection.UploadProgressHandler -=
						fup.HandleProgress;
			}
		}