Example #1
0
 // args [0] -> user name, args [1] -> album title
 static void Main(string [] args)
 {
     ServicePointManager.ServerCertificateValidationCallback +=  delegate { return true; };
     GoogleConnection conn = new GoogleConnection (GoogleService.Picasa);
     Console.Write ("Password: "******"Album created. Title: {0} Unique ID: {1}", album.Title, album.UniqueID);
 }
Example #2
0
        public GoogleAddAlbum(GoogleExport export, Mono.Google.Picasa.PicasaWeb picasa)
        {
            builder = new GtkBeans.Builder(null, "google_add_album_dialog.ui", null);
            builder.Autoconnect(this);

            this.export = export;
            this.picasa = picasa;

            Dialog.Response += HandleAddResponse;

            description_entry.Changed += HandleChanged;
            title_entry.Changed       += HandleChanged;
            HandleChanged(null, null);
        }
Example #3
0
        public GoogleAddAlbum(GoogleExport export, Mono.Google.Picasa.PicasaWeb picasa)
        {
            builder = new GtkBeans.Builder (null, "google_add_album_dialog.ui", null);
            builder.Autoconnect (this);

            this.export = export;
            this.picasa = picasa;

            Dialog.Response += HandleAddResponse;

            description_entry.Changed += HandleChanged;
            title_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Example #4
0
        private void PopulateAlbumOptionMenu(Mono.Google.Picasa.PicasaWeb picasa)
        {
            if (picasa != null)
            {
                try {
                    albums = picasa.GetAlbums();
                } catch {
                    Log.Warning("Picasa: can't get the albums");
                    albums = null;
                    picasa = null;
                }
            }

            bool disconnected = picasa == null || !account.Connected || albums == null;

            if (disconnected || albums.Count == 0)
            {
                string msg = disconnected ? Catalog.GetString("(Not Connected)")
                                        : Catalog.GetString("(No Albums)");

                album_optionmenu.AppendText(msg);

                export_button.Sensitive    = false;
                album_optionmenu.Sensitive = false;
                album_button.Sensitive     = false;

                if (disconnected)
                {
                    album_button.Sensitive = false;
                }
            }
            else
            {
                foreach (PicasaAlbum album in albums.AllValues)
                {
                    System.Text.StringBuilder label_builder = new System.Text.StringBuilder();

                    label_builder.Append(album.Title);
                    label_builder.Append(" (" + album.PicturesCount + ")");

                    album_optionmenu.AppendText(label_builder.ToString());
                }

                export_button.Sensitive    = items.Length > 0;
                album_optionmenu.Sensitive = true;
                album_button.Sensitive     = true;
            }
        }
		public PicasaWeb Connect ()
		{
			System.Console.WriteLine ("GoogleAccount.Connect()");
			GoogleConnection conn = new GoogleConnection (GoogleService.Picasa);
			ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
			if (unlock_captcha == null || token == null)
				conn.Authenticate(username, password);
			else {
				conn.Authenticate(username, password, token, unlock_captcha);
				token = null;
				unlock_captcha = null;
			}
			connection = conn;
			PicasaWeb picasa = new PicasaWeb(conn);
			this.picasa = picasa;
			return picasa;
		}
Example #6
0
    static void Main(string [] args)
    {
        Console.Write ("User name: ");
        string user = Console.ReadLine ();
        Console.Write ("Password: "******"")
            picasa = new PicasaWeb (conn, user);
        else {
            conn.Authenticate (user, password);
            picasa = new PicasaWeb (conn);
        }
        Console.WriteLine ("Picasa: Title: {0}, User: {1}, NickName: {2}, QuotaUsed: {3}, QuotaLimit: {4}\n", picasa.Title, picasa.User, picasa.NickName, picasa.QuotaUsed, picasa.QuotaLimit);
        PicasaAlbumCollection coll = picasa.GetAlbums ();
        foreach (PicasaAlbum album in coll.AllValues) {
            Console.WriteLine ("Title: {0} ID: {1}", album.Title, album.UniqueID);
        }
    }
Example #7
0
        public Mono.Google.Picasa.PicasaWeb Connect()
        {
            Log.Debug("GoogleAccount.Connect()");
            GoogleConnection conn = new GoogleConnection(GoogleService.Picasa);

            ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy();
            if (unlock_captcha == null || token == null)
            {
                conn.Authenticate(username, password);
            }
            else
            {
                conn.Authenticate(username, password, token, unlock_captcha);
                token          = null;
                unlock_captcha = null;
            }
            connection = conn;
            var picasa = new Mono.Google.Picasa.PicasaWeb(conn);

            this.picasa = picasa;
            return(picasa);
        }
		private void PopulateAlbumOptionMenu (PicasaWeb picasa)
		{
			if (picasa != null) {
				try {
					albums = picasa.GetAlbums();
				} catch {
					Console.WriteLine("Can't get the albums");
					albums = null;
					picasa = null;
				}
			}

			Gtk.Menu menu = new Gtk.Menu ();

			bool disconnected = picasa == null || !account.Connected || albums == null;

			if (disconnected || albums.Count == 0) {
				string msg = disconnected ? Catalog.GetString ("(Not Connected)")
					: Catalog.GetString ("(No Albums)");

				Gtk.MenuItem item = new Gtk.MenuItem (msg);
				menu.Append (item);

				export_button.Sensitive = false;
				album_optionmenu.Sensitive = false;
				album_button.Sensitive = false;

				if (disconnected)
					album_button.Sensitive = false;
			} else {
				foreach (PicasaAlbum album in albums.AllValues) {
					System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();

					label_builder.Append (album.Title);
					label_builder.Append (" (" + album.PicturesCount + ")");

					Gtk.MenuItem item = new Gtk.MenuItem (label_builder.ToString ());
					((Gtk.Label)item.Child).UseUnderline = false;
					menu.Append (item);
				}

				export_button.Sensitive = items.Length > 0;
				album_optionmenu.Sensitive = true;
				album_button.Sensitive = true;
			}

			menu.ShowAll ();
			album_optionmenu.Menu = menu;
		}
		public GoogleAddAlbum (GoogleExport export, PicasaWeb picasa)
		{
			xml = new Glade.XML (null, "PicasaWebExport.glade", dialog_name, "f-spot");
			xml.Autoconnect (this);

			this.export = export;
			this.picasa = picasa;

			Dialog.Response += HandleAddResponse;

			description_entry.Changed += HandleChanged;
			title_entry.Changed += HandleChanged;
			HandleChanged (null, null);
		}
 public void login()
 {
     try {
         connection = new GoogleConnection(GoogleService.Picasa);
         //ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy();
         connection.Authenticate(this.username, this.password);
         web = new PicasaWeb(connection);
         this.loggedIn = true;
     } catch (Exception) {
         this.loggedIn = false;
     }
 }
		public GoogleAddAlbum (GoogleExport export, PicasaWeb picasa) : base ("google_add_album_dialog")
		{
			this.export = export;
			this.picasa = picasa;	
			
			Dialog.Response += HandleAddResponse;

			description_entry.Changed += HandleChanged;
			title_entry.Changed += HandleChanged;
			HandleChanged (null, null);
		}