/// <summary>
        /// Return photos from the given user's photostream. Only photos visible to the calling user will be returned. This method must be authenticated;
        /// </summary>
        /// <param name="userId">The NSID of the user who's photos to return. A value of "me" will return the calling user's photos.</param>
        /// <param name="safeSearch">Safe search setting</param>
        /// <param name="minUploadDate">Minimum upload date. Photos with an upload date greater than or equal to this value will be returned.</param>
        /// <param name="maxUploadDate">Maximum upload date. Photos with an upload date less than or equal to this value will be returned.</param>
        /// <param name="minTakenDate">Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. </param>
        /// <param name="maxTakenDate">Maximum taken date. Photos with an taken date less than or equal to this value will be returned. </param>
        /// <param name="contentType">Content Type setting</param>
        /// <param name="privacyFilter">Return photos only matching a certain privacy level.</param>
        /// <param name="extras">A list of extra information to fetch for each returned record.</param>
        /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param>
        /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public void PeopleGetPhotosAsync(string userId, SafetyLevel safeSearch, DateTime minUploadDate,
                                         DateTime maxUploadDate, DateTime minTakenDate, DateTime maxTakenDate,
                                         ContentTypeSearch contentType, PrivacyFilter privacyFilter,
                                         PhotoSearchExtras extras, int page, int perPage,
                                         Action <FlickrResult <PhotoCollection> > callback)
        {
            CheckRequiresAuthentication();

            var parameters = new Dictionary <string, string>();

            parameters.Add("method", "flickr.people.getPhotos");
            parameters.Add("user_id", userId ?? "me");
            if (safeSearch != SafetyLevel.None)
            {
                parameters.Add("safe_search", safeSearch.ToString("d"));
            }
            if (minUploadDate != DateTime.MinValue)
            {
                parameters.Add("min_upload_date", UtilityMethods.DateToUnixTimestamp(minUploadDate));
            }
            if (maxUploadDate != DateTime.MinValue)
            {
                parameters.Add("max_upload_date", UtilityMethods.DateToUnixTimestamp(maxUploadDate));
            }
            if (minTakenDate != DateTime.MinValue)
            {
                parameters.Add("min_taken_date", UtilityMethods.DateToMySql(minTakenDate));
            }
            if (maxTakenDate != DateTime.MinValue)
            {
                parameters.Add("max_taken_date", UtilityMethods.DateToMySql(maxTakenDate));
            }

            if (contentType != ContentTypeSearch.None)
            {
                parameters.Add("content_type", contentType.ToString("d"));
            }
            if (privacyFilter != PrivacyFilter.None)
            {
                parameters.Add("privacy_filter", privacyFilter.ToString("d"));
            }
            if (extras != PhotoSearchExtras.None)
            {
                parameters.Add("extras", UtilityMethods.ExtrasToString(extras));
            }

            if (page > 0)
            {
                parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            }
            if (perPage > 0)
            {
                parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            }

            GetResponseAsync <PhotoCollection>(parameters, callback);
        }
Example #2
0
        /// <summary>
        /// Return photos from the given user's photostream. Only photos visible to the calling user will be returned. This method must be authenticated;
        /// </summary>
        /// <param name="userId">The NSID of the user who's photos to return. A value of "me" will return the calling user's photos.</param>
        /// <param name="safeSearch">Safe search setting</param>
        /// <param name="minUploadDate">Minimum upload date. Photos with an upload date greater than or equal to this value will be returned.</param>
        /// <param name="maxUploadDate">Maximum upload date. Photos with an upload date less than or equal to this value will be returned.</param>
        /// <param name="minTakenDate">Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. </param>
        /// <param name="maxTakenDate">Maximum taken date. Photos with an taken date less than or equal to this value will be returned. </param>
        /// <param name="contentType">Content Type setting</param>
        /// <param name="privacyFilter">Return photos only matching a certain privacy level.</param>
        /// <param name="extras">A list of extra information to fetch for each returned record.</param>
        /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param>
        /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.</param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public void PeopleGetPhotosAsync(string userId, SafetyLevel safeSearch, DateTime minUploadDate, DateTime maxUploadDate, DateTime minTakenDate, DateTime maxTakenDate, ContentTypeSearch contentType, PrivacyFilter privacyFilter, PhotoSearchExtras extras, int page, int perPage, Action<FlickrResult<PhotoCollection>> callback)
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters.Add("method", "flickr.people.getPhotos");
            parameters.Add("user_id", userId ?? "me");
            if (safeSearch != SafetyLevel.None) parameters.Add("safe_search", safeSearch.ToString("d"));
            if (minUploadDate != DateTime.MinValue) parameters.Add("min_upload_date", UtilityMethods.DateToUnixTimestamp(minUploadDate));
            if (maxUploadDate != DateTime.MinValue) parameters.Add("max_upload_date", UtilityMethods.DateToUnixTimestamp(maxUploadDate));
            if (minTakenDate != DateTime.MinValue) parameters.Add("min_taken_date", UtilityMethods.DateToMySql(minTakenDate));
            if (maxTakenDate != DateTime.MinValue) parameters.Add("max_taken_date", UtilityMethods.DateToMySql(maxTakenDate));

            if (contentType != ContentTypeSearch.None) parameters.Add("content_type", contentType.ToString("d"));
            if (privacyFilter != PrivacyFilter.None) parameters.Add("privacy_filter", privacyFilter.ToString("d"));
            if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras));

            if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));

            GetResponseAsync<PhotoCollection>(parameters, callback);
        }
 public PhotoCollection PeopleGetPhotos(string userId, SafetyLevel safeSearch, DateTime? minUploadDate, DateTime? maxUploadDate, DateTime? minTakenDate, DateTime? maxTakenDate, ContentTypeSearch contentType, PrivacyFilter privacyFilter, PhotoSearchExtras extras, int page, int perPage)
 {
     var dictionary = new Dictionary<string, string>();
     dictionary.Add("method", "flickr.people.getPhotos");
     dictionary.Add("user_id", userId);
     if (safeSearch != SafetyLevel.None) dictionary.Add("safe_search", safeSearch.ToString("d"));
     if (minUploadDate != null) dictionary.Add("min_upload_date", minUploadDate.Value.ToUnixTimestamp());
     if (maxUploadDate != null) dictionary.Add("max_upload_date", maxUploadDate.Value.ToUnixTimestamp());
     if (minTakenDate != null) dictionary.Add("min_taken_date", minTakenDate.Value.ToMySql());
     if (maxTakenDate != null) dictionary.Add("max_taken_date", maxTakenDate.Value.ToMySql());
     if (contentType != ContentTypeSearch.None) dictionary.Add("content_type", contentType.ToString("d"));
     if (privacyFilter != PrivacyFilter.None) dictionary.Add("privacy_filter", privacyFilter.ToString("d"));
     if (extras != PhotoSearchExtras.None) dictionary.Add("extras", UtilityMethods.ExtrasToString(extras));
     if (page != 0) dictionary.Add("page", page.ToString(CultureInfo.InvariantCulture));
     if (perPage != 0) dictionary.Add("per_page", perPage.ToString(CultureInfo.InvariantCulture));
     return GetResponse<PhotoCollection>(dictionary);
 }
 public PhotoCollection PeopleGetPhotos(string userId, SafetyLevel safeSearch, DateTime minUploadDate,
                                        DateTime maxUploadDate, DateTime minTakenDate, DateTime maxTakenDate,
                                        ContentTypeSearch contentType, PrivacyFilter privacyFilter,
                                        PhotoSearchExtras extras, int page, int perPage);