예제 #1
0
        public IEnumerable <string> GetRoots()
        {
            yield return("/"); // for photos not in a set

            int page     = 1;
            int maxPages = 1;

            while (page <= maxPages)
            {
                // existing sources gives us a list of photoset ids
                PhotosetCollection photosets;
                try
                {
                    photosets = _flickr.PhotosetsGetList();
                    maxPages  = photosets.Pages;
                    page++;
                }
                catch
                {
                    photosets = new PhotosetCollection();
                }
                foreach (var root in photosets.Select(s => s.PhotosetId + "/"))
                {
                    yield return(root);
                }
            }
        }
        public List <Album> GetAlbums()
        {
            PhotosetCollection albums    = Flickr.PhotosetsGetList();
            List <Album>       albumlist = albums.Select(x => Album.CreateAlbum(x)).ToList();

            return(albumlist);
        }
예제 #3
0
        public Albums Convert(PhotosetCollection photosets)
        {
            var items = photosets
                        .Select(Convert)
                        .ToArray();

            return(new Albums(items));
        }
예제 #4
0
        public void RemoveNonExisting(PhotosetCollection setL)
        {
            var d = db.Sets.ToList().Where(r => (setL.Select(r1 => r1.PhotosetId).Contains(r.SetsID) == false) &&
                                           r.UserID == Flickr.User.UserId);

            db.Sets.RemoveRange(d);
            db.SaveChanges();
        }
예제 #5
0
        public Albums Convert(PhotosetCollection photosets)
        {
            var items = photosets
                .Select(Convert)
                .ToArray();

            return new Albums(items);
        }
 public void RemoveNonExisting(PhotosetCollection setL)
 {
     var d = db.Sets.ToList().Where(r => (setL.Select(r1 => r1.PhotosetId).Contains(r.SetsID) == false)
         && r.UserID == Flickr.User.UserId);
     db.Sets.RemoveRange(d);
     db.SaveChanges();
 }
예제 #7
0
        public void PhotosetsOrderSetsArrayTest()
        {
            PhotosetCollection mySets = AuthInstance.PhotosetsGetList();

            AuthInstance.PhotosetsOrderSets(mySets.Select(myset => myset.PhotosetId));
        }