The context of the current photo, as returned by Flickr.PhotosGetContext, Flickr.PhotosetsGetContext and Flickr.GroupsPoolsGetContext methods.
Inheritance: IFlickrParsable
Ejemplo n.º 1
0
        /// <summary>
        /// Gets the context for a photo from within a group. This provides the
        /// id and thumbnail url for the next and previous photos in the group.
        /// </summary>
        /// <param name="photoId">The Photo ID for the photo you want the context for.</param>
        /// <param name="groupId">The group ID for the group you want the context to be relevant to.</param>
        /// <returns>The <see cref="Context"/> of the photo in the group.</returns>
        public Context GroupPoolGetContext(string photoId, string groupId)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.groups.pools.getContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("group_id", groupId);
            FlickrNet.Response response = GetResponseCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                Context context = new Context();
                context.Count = response.ContextCount.Count;
                context.NextPhoto = response.ContextNextPhoto;
                context.PreviousPhoto = response.ContextPrevPhoto;
                return context;
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the context of the photo in the users photostream.
        /// </summary>
        /// <param name="photoId">The ID of the photo to return the context for.</param>
        /// <returns></returns>
        public Context PhotosGetContext(string photoId)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.photos.getContext");
            parameters.Add("photo_id", photoId);

            FlickrNet.Response response = GetResponseCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                Context c = new Context();
                c.Count = response.ContextCount.Count;
                c.NextPhoto = response.ContextNextPhoto;
                c.PreviousPhoto = response.ContextPrevPhoto;

                return c;
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }