/// <summary> /// Searches for photos in the given latitude/longitude range. /// </summary> /// <param name="latLong"></param> /// <returns></returns> public static FlickrPhotos SearchForPhotos(Rect latLong) { FlickrMethod method = new FlickrMethod(ApiKey, "flickr.photos.search"); method.AddParameter("accuracy", "1"); method.AddParameter("extras", "geo"); string searchString = latLong.Left + "," + latLong.Top + "," + latLong.Right + "," + latLong.Bottom; method.AddParameter("bbox", searchString); FlickrPhotos photos = new FlickrPhotos(method, 50); photos.GetPhoto(0); // we call this to force the call to get the total # count return photos; }
/// <summary> /// Gets the list of a users most recently updated photos /// </summary> /// <param name="user"></param> /// <returns></returns> public static FlickrPhotos GetRecentlyUpdated(AuthorizedFlickrUser user) { FlickrMethod method = new FlickrMethod(ApiKey, "flickr.photos.recentlyUpdated", user.Token, SharedSecret); int updateTime = 1; method.AddParameter("min_date", updateTime.ToString()); FlickrPhotos photos = new FlickrPhotos(method, 50, user); photos.GetPhoto(0); // we call this to force the call to get the total # count return photos; }
/// <summary> /// Searches for photos based upon the given query string /// </summary> /// <param name="query"></param> /// <returns></returns> public static FlickrPhotos SearchForPhotos(string query) { FlickrMethod method = new FlickrMethod(ApiKey, "flickr.photos.search"); method.AddParameter("text", query); method.AddParameter("sort", "relevance"); FlickrPhotos photos = new FlickrPhotos(method, 50); photos.GetPhoto(0); // we call this to force the call to get the total # count return photos; }
/// <summary> /// Asynchronously gets the photo at the given index from the list of photos /// </summary> /// <param name="photos"></param> /// <param name="index"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetPhoto(FlickrPhotos photos, int index, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { FlickrPhoto photo = photos.GetPhoto(index); if (photo != null) { string info = GetPhotoInfo(photo); photo.Info = info; if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, photo); } } } ); }