Exemple #1
0
        private void propertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (null == pam || false == pam.LoggedIn)
            {
                NotifyDialog please_login = new NotifyDialog();
                please_login.NotificationMessage = "Please login, then proceed to upload.";
                please_login.ShowDialog();
            }
            else
            {
                OpenFileDialog get_filenames_to_upload = new OpenFileDialog();
                get_filenames_to_upload.Multiselect = true;
                if (get_filenames_to_upload.ShowDialog() == DialogResult.OK)
                {
                    string next_page = "";
                    next_page += "<html><head><title>";
                    next_page += "Photo Upload";
                    next_page += "</title></head><body>";
                    next_page += "Uploading " + get_filenames_to_upload.FileNames.Length;

                    if (get_filenames_to_upload.FileNames.Length > 1)
                    {
                        next_page += " photos ";
                    }
                    else if (get_filenames_to_upload.FileNames.Length == 1)
                    {
                        next_page += " photo ";
                    }
                    else
                    {
                        throw new Exception("Must select 1 or more photos for upload!");
                    }

                    next_page += "to " + myAlbums[albumList.SelectedIndex].Title + " ...";

                    next_page += "</br>";
                    next_page += "</body></html>";

                    albumPhotoBrowser.DocumentText = next_page;

                    StupidContainer stupid = new StupidContainer();
                    stupid.album     = myAlbums[albumList.SelectedIndex];
                    stupid.filenames = get_filenames_to_upload.FileNames;

                    if (display_photos_thread != null)
                    {
                        display_photos_thread.Abort();
                    }
                    display_photos_thread = new Thread(get_album_thumbs_from_local);
                    display_photos_thread.Start(stupid);
                }
            }
        }
Exemple #2
0
        private void get_album_thumbs_from_local(Object data)
        {
            StupidContainer stupid             = (StupidContainer)data;
            PicasaAlbum     album_to_upload_to = stupid.album;

            string[] filenames = stupid.filenames;

            /*string next_page = "";
             * next_page += "<html><head><title>";
             * next_page += "Photos to Upload";
             * next_page += "</title></head><body>";
             * next_page += "Photos to Upload"; ;
             * next_page += "</br>";*/
            foreach (string filename in filenames)
            {
                album_to_upload_to.UploadPicture(filename);

                //next_page += "<img width=\"100px\" src=\"";
                //next_page += filename;
                //next_page += "\"/>";
            }

            //albumPhotoBrowser.DocumentText = next_page;
            System.Console.WriteLine("Done uploading");

            string next_page = "";

            next_page += "<html><head><title>";
            next_page += "Upload results";
            next_page += "</title></head><body>";
            next_page += "Finished Uploading.";
            next_page += "</br>";
            next_page += "Album Name: " + album_to_upload_to.Title;
            next_page += "</br>";
            next_page += "Photos: ";
            next_page += "</br>";
            foreach (PicasaPicture pic in album_to_upload_to.GetPictures().AllValues)
            {
                next_page += "<img src=\"";
                next_page += pic.ThumbnailURL;
                next_page += "\"/>";
            }


            next_page += "</body></html>";

            albumPhotoBrowser.DocumentText = next_page;
        }
Exemple #3
0
        private void propertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (null == pam || false == pam.LoggedIn) {
                NotifyDialog please_login = new NotifyDialog();
                please_login.NotificationMessage = "Please login, then proceed to upload.";
                please_login.ShowDialog();
            } else {

                OpenFileDialog get_filenames_to_upload = new OpenFileDialog();
                get_filenames_to_upload.Multiselect = true;
                if (get_filenames_to_upload.ShowDialog() == DialogResult.OK) {

                    string next_page = "";
                    next_page += "<html><head><title>";
                    next_page += "Photo Upload";
                    next_page += "</title></head><body>";
                    next_page += "Uploading " + get_filenames_to_upload.FileNames.Length;

                    if (get_filenames_to_upload.FileNames.Length > 1) {
                        next_page += " photos ";
                    } else if (get_filenames_to_upload.FileNames.Length == 1) {
                        next_page += " photo ";
                    } else {
                        throw new Exception("Must select 1 or more photos for upload!");
                    }

                    next_page += "to " + myAlbums[albumList.SelectedIndex].Title + " ...";

                    next_page += "</br>";
                    next_page += "</body></html>";

                    albumPhotoBrowser.DocumentText = next_page;

                    StupidContainer stupid = new StupidContainer();
                    stupid.album = myAlbums[albumList.SelectedIndex];
                    stupid.filenames = get_filenames_to_upload.FileNames;

                    if (display_photos_thread != null) {
                        display_photos_thread.Abort();
                    }
                    display_photos_thread = new Thread(get_album_thumbs_from_local);
                    display_photos_thread.Start(stupid);

                }
            }
        }