GroupPoolGetPhotos with OwnerName?

Topics: Developer Forum
Aug 19, 2010 at 2:38 PM

Hi Folks,

I'm pretty new to using FlickrNet so I might be making a simple mistake, but I'm wondering how to pull the OwnerName with a GroupPoolGetPhotos search and display it in a repeater.  As of right now this is returning that DataBinding: 'FlickrNet.Photo' does not contain a property with the name 'OwnerName'.  I can bind UserId and DateAdded to the repeater however.  Any suggestions or an idea for an alternative way of implementing this would be awesome:

public static FlickrNet.PhotoCollection RecentGroupPhotos()
    {
        FlickrNet.Flickr flickr = new FlickrNet.Flickr();

        FlickrNet.PhotoSearchOptions searchOptions = new FlickrNet.PhotoSearchOptions();
        searchOptions.Extras = FlickrNet.PhotoSearchExtras.OwnerName;

        FlickrNet.PhotoCollection GroupPhotos = flickr.GroupPoolGetPhotos("1327110@N20", "", "", searchOptions.Extras,5,1).PhotoCollection;

        if (GroupPhotos == null)
            return new FlickrNet.Photo[0];
        else
            return GroupPhotos;
    }

Thanks!

 

Coordinator
Aug 19, 2010 at 3:02 PM
I think you must be using an older version of the FlickrNet dll.

GroupsPoolsGetPhotos (note the spelling) now returns a simple
PhotoCollection, which is a list of Photo objects, which does have a
OwnerName property.

The following should work fine:

public static FlickrNet.PhotoCollection RecentGroupPhotos()
{
FlickrNet.Flickr flickr = new FlickrNet.Flickr();
return flickr.GroupPoolGetPhotos("1327110@N20", "", "",
FlickrNet.PhotoSearchExtras.OwnerName,5,1);
}
Coordinator
Aug 19, 2010 at 3:57 PM
Note also, previous versions had a OwnerName field, but data binding doesn't work on fields, only properties. All the data is now exposed as properties, so should work fine.

Sam
Aug 19, 2010 at 5:03 PM

Thanks Sam!  You were exactly right, I was using an older version of the FlickrNet dll.  I grabbed the latest version and  referenced your example and now everything's working perfectly.  Thanks again for the help!

Dave