PhotosetsAddPhoto() public method

Add a photo to a photoset.
public PhotosetsAddPhoto ( string photosetId, string photoId ) : void
photosetId string The ID of the photoset to add the photo to.
photoId string The ID of the photo to add.
return void
Exemplo n.º 1
3
        public IPhoto UploadPhoto(Stream stream, string filename, string title, string description, string tags)
        {
            using (MiniProfiler.Current.Step("FlickrPhotoRepository.UploadPhoto"))
            {
                Flickr fl = new Flickr();

                string authToken = (ConfigurationManager.AppSettings["FlickrAuth"] ?? "").ToString();
                if (string.IsNullOrEmpty(authToken))
                    throw new ApplicationException("Missing Flickr Authorization");

                fl.AuthToken = authToken;
                string photoID = fl.UploadPicture(stream, filename, title, description, tags, true, true, false,
                    ContentType.Photo, SafetyLevel.Safe, HiddenFromSearch.Visible);
                var photo = fl.PhotosGetInfo(photoID);
                var allSets = fl.PhotosetsGetList();
                var blogSet = allSets
                                .FirstOrDefault(s => s.Description == "Blog Uploads");
                if (blogSet != null)
                    fl.PhotosetsAddPhoto(blogSet.PhotosetId, photo.PhotoId);

                FlickrPhoto fphoto = new FlickrPhoto();
                fphoto.Description = photo.Description;
                fphoto.WebUrl = photo.MediumUrl;
                fphoto.Title = photo.Title;
                fphoto.Description = photo.Description;

                return fphoto;
            }
        }
Exemplo n.º 2
0
        private void UpdatePhotoButton_Click(object sender, EventArgs e)
        {
            Flickr flickr = new Flickr(ApiKey.Text, SharedSecret.Text, AuthToken.Text);

            flickr.PhotosSetMeta(PhotoId.Text, NewTitle.Text, null);

            OutputTextbox.Text += "Photo title updated";

            PhotosetCollection sets = flickr.PhotosetsGetList();
            Photoset set = sets[0];

            flickr.PhotosetsAddPhoto(set.PhotosetId, PhotoId.Text);
        }
Exemplo n.º 3
0
        private void persistableOutput_ImageCaptured(object sender, ImageCapturedEventArgs e)
        {
            FileStream stream1 = new FileStream(e.ImageNames.FullSize, FileMode.CreateNew);

            e.FullSizeImage.Save(stream1, ImageFormat.Png);
            stream1.Close();
            if (e.IsThumbnailed)
            {
                stream1 = new FileStream(e.ImageNames.Thumbnail, FileMode.CreateNew);
                e.ThumbnailImage.Save(stream1, ImageFormat.Png);
                stream1.Close();
            }
            if (this.ConfigExists)
            {
                Settings         settings1 = new Settings(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AltmanSoftware.Cropper.FlickrOutput Plugin\AltmanSoftware.Cropper.FlickrOutput.config");
                FlickrNet.Flickr flickr1   = new FlickrNet.Flickr("ab782e182b4eb406d285211811d625ff", "b080496c05335c3d", settings1.Token);
                PhotoDetails     details1  = new PhotoDetails(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AltmanSoftware.Cropper.FlickrOutput Plugin\AltmanSoftware.Cropper.FlickrOutput.config");
                if (details1.ShowDialog() == DialogResult.OK)
                {
                    string text1 = flickr1.UploadPicture(e.ImageNames.FullSize, details1.Title, details1.Description, details1.Tags, details1.IsPublic, details1.IsFamily, details1.IsFriend);
                    if ((details1.PhotoSetId != null) && (details1.PhotoSetId != string.Empty))
                    {
                        MessageBox.Show(details1.PhotoSetId);
                        flickr1.PhotosetsAddPhoto(details1.PhotoSetId, text1);
                    }
                    if (e.IsThumbnailed)
                    {
                        string text2 = flickr1.UploadPicture(e.ImageNames.Thumbnail, details1.Title + " Thumbnail", details1.Description, details1.Tags, details1.IsPublic, details1.IsFamily, details1.IsFriend);
                        if ((details1.PhotoSetId != null) && (details1.PhotoSetId != string.Empty))
                        {
                            flickr1.PhotosetsAddPhoto(details1.PhotoSetId, text2);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// this method will add a given photograph to the specificed photoset
 /// </summary>
 /// <param name="photoSetId">ID of the photoset</param>
 /// <param name="photoId">ID of the photo</param>
 private void AddPhotoToPhotoset(string photoSetId, string photoId)
 {
     flickr.PhotosetsAddPhoto(photoSetId, photoId);
     flickr.GroupsPoolsAdd(photoId, Utility.FlickrGroupID);
 }
Exemplo n.º 5
0
    public Result AddPhotoToPhotoset(AddPhotoToPhotosetRequest request)
    {
        _flickr.PhotosetsAddPhoto(request.PhotosetId, request.PhotoId);

        return(Result.Success());
    }