/// <summary> /// Asynchrnousy posts comments about the given photo. /// </summary> /// <param name="comments"></param> /// <param name="photo"></param> /// <param name="user"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchPostComments(string comments, FlickrPhoto photo, AuthorizedFlickrUser user, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { bool result = PostComments(comments, photo, user); if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, result); } } ); }
/// <summary> /// Asynchronously searches for photo in the given latitude/longitude rectangle /// </summary> /// <param name="latLong"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchSearchForPhotos(Rect latLong, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { FlickrPhotos photos = SearchForPhotos(latLong); if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, photos); } } ); }
/// <summary> /// Asynchronously gets the icon for the given user. /// </summary> /// <param name="userid"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetUserPhoto(string userid, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { XmlNode userInformation = GetUserInfo(userid); int iconServer = Int32.Parse(userInformation.Attributes["iconserver"].InnerText); string iconUrl; if (iconServer > 0) { iconUrl = "http://static.flickr.com/" + iconServer + "/buddyicons/" + userid + ".jpg"; } else { iconUrl = "http://www.flickr.com/images/buddyicon.jpg"; } if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, iconUrl); } } ); }
/// <summary> /// Loads the given range of Flickr photos asynchronously /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="photos"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchLoadPhotoRange(int start, int end, FlickrPhotos photos, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { DateTime requestTime = DateTime.Now; AddToWorkQueue(delegate() { if (photos.LoadRange(start, end, requestTime)) { if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, photos); } } } ); }
/// <summary> /// Asynchronously gets the most recently updated photos for a given user /// </summary> /// <param name="user"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetRecentlyUpdated(AuthorizedFlickrUser user, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { { AddToWorkQueue(delegate() { FlickrPhotos photos = GetRecentlyUpdated(user); if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, photos); } } ); } }
/// <summary> /// Asynchronously gets the location for the given photo. /// </summary> /// <param name="photo"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetPhotoLocation(FlickrPhoto photo, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { string location = GetPhotoLocation(photo); photo.Location = location; if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, location); } } ); }
/// <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); } } } ); }
/// <summary> /// Asynchronously gets a frob /// </summary> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetFrob(Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { string frob = GetFrob(); if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, frob); } } ); }
/// <summary> /// Asynchronously gets an authenticated user /// </summary> /// <param name="frob"></param> /// <param name="notificationDispatcher"></param> /// <param name="notificationEvent"></param> public static void AsynchGetAuthenticatedUser(string frob, Dispatcher notificationDispatcher, FlickrWorkCompleteDelegate notificationEvent) { AddToWorkQueue(delegate() { AuthorizedFlickrUser user = GetAuthorizationInfo(frob); if (notificationDispatcher != null && notificationEvent != null) { notificationDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, notificationEvent, user); } } ); }