コード例 #1
0
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">ontext is a numeric value representing the photo's geotagginess beyond latitude and longitude.
        /// For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        public void PhotosGeoSetContext(string photoId, GeoContext context)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            GetResponseNoCache <NoResponse>(parameters);
        }
コード例 #2
0
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">Context is a numeric value representing the photo's geotagginess beyond latitude and longitude.
        /// For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public void PhotosGeoSetContextAsync(string photoId, GeoContext context, Action <FlickrResult <NoResponse> > callback)
        {
            var parameters = new Dictionary <string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            GetResponseAsync <NoResponse>(parameters, callback);
        }
コード例 #3
0
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">ontext is a numeric value representing the photo's geotagginess beyond latitude and longitude. For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public async Task <FlickrResult <NoResponse> > PhotosGeoSetContextAsync(string photoId, GeoContext context)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            return(await GetResponseAsync <NoResponse>(parameters));
        }
コード例 #4
0
        /// <summary>
        /// Sets the geo location for a photo.
        /// </summary>
        /// <param name="photoId">The ID of the photo to set to location for.</param>
        /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00.
        /// Digits beyond 6 decimal places will be truncated.</param>
        /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00.
        /// Digits beyond 6 decimal places will be truncated.</param>
        /// <param name="accuracy">The accuracy of the photos geo location.</param>
        /// <param name="context">The context of the geolocation data, i.e. Inside or Outside.</param>
        public void PhotosGeoSetLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, GeoContext context)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("method", "flickr.photos.geo.setLocation");
            parameters.Add("photo_id", photoId);
            parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            if (accuracy != GeoAccuracy.None)
            {
                parameters.Add("accuracy", accuracy.ToString("D"));
            }
            if (context != GeoContext.NotDefined)
            {
                parameters.Add("context", context.ToString("D"));
            }

            GetResponseNoCache <NoResponse>(parameters);
        }
コード例 #5
0
 /// <summary>
 /// Takes the various properties of this instance and adds them to a <see cref="Dictionary{K,V}"/> instanced passed in, ready for sending to Flickr.
 /// </summary>
 /// <param name="parameters">The <see cref="Dictionary{K,V}"/> to add the options to.</param>
 public void AddToDictionary(Dictionary <string, string> parameters)
 {
     if (!string.IsNullOrEmpty(UserId))
     {
         parameters.Add("user_id", UserId);
     }
     if (!string.IsNullOrEmpty(GroupId))
     {
         parameters.Add("group_id", GroupId);
     }
     if (!string.IsNullOrEmpty(Text))
     {
         parameters.Add("text", Text);
     }
     if (!string.IsNullOrEmpty(Tags))
     {
         parameters.Add("tags", Tags);
     }
     if (TagMode != TagMode.None)
     {
         parameters.Add("tag_mode", UtilityMethods.TagModeToString(TagMode));
     }
     if (!string.IsNullOrEmpty(MachineTags))
     {
         parameters.Add("machine_tags", MachineTags);
     }
     if (MachineTagMode != MachineTagMode.None)
     {
         parameters.Add("machine_tag_mode", UtilityMethods.MachineTagModeToString(MachineTagMode));
     }
     if (MinUploadDate != DateTime.MinValue)
     {
         parameters.Add("min_upload_date", UtilityMethods.DateToUnixTimestamp(MinUploadDate).ToString());
     }
     if (MaxUploadDate != DateTime.MinValue)
     {
         parameters.Add("max_upload_date", UtilityMethods.DateToUnixTimestamp(MaxUploadDate).ToString());
     }
     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 (Licenses.Count != 0)
     {
         var licenseArray = new List <string>();
         foreach (var license in Licenses)
         {
             licenseArray.Add(license.ToString("d"));
         }
         parameters.Add("license", String.Join(",", licenseArray.ToArray()));
     }
     if (PerPage != 0)
     {
         parameters.Add("per_page", PerPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if (Page != 0)
     {
         parameters.Add("page", Page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if (Extras != PhotoSearchExtras.None)
     {
         parameters.Add("extras", ExtrasString);
     }
     if (SortOrder != PhotoSearchSortOrder.None)
     {
         parameters.Add("sort", SortOrderString);
     }
     if (PrivacyFilter != PrivacyFilter.None)
     {
         parameters.Add("privacy_filter", PrivacyFilter.ToString("d"));
     }
     if (BoundaryBox != null && BoundaryBox.IsSet)
     {
         parameters.Add("bbox", BoundaryBox.ToString());
     }
     if (Accuracy != GeoAccuracy.None)
     {
         parameters.Add("accuracy", Accuracy.ToString("d"));
     }
     if (SafeSearch != SafetyLevel.None)
     {
         parameters.Add("safe_search", SafeSearch.ToString("d"));
     }
     if (ContentType != ContentTypeSearch.None)
     {
         parameters.Add("content_type", ContentType.ToString("d"));
     }
     if (HasGeo != null)
     {
         parameters.Add("has_geo", HasGeo.Value ? "1" : "0");
     }
     if (Latitude != null)
     {
         parameters.Add("lat", Latitude.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if (Longitude != null)
     {
         parameters.Add("lon", Longitude.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if (Radius != null)
     {
         parameters.Add("radius", Radius.Value.ToString("0.00000", System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if (RadiusUnits != RadiusUnit.None)
     {
         parameters.Add("radius_units", (RadiusUnits == RadiusUnit.Miles ? "mi" : "km"));
     }
     if (Contacts != ContactSearch.None)
     {
         parameters.Add("contacts", (Contacts == ContactSearch.AllContacts ? "all" : "ff"));
     }
     if (WoeId != null)
     {
         parameters.Add("woe_id", WoeId);
     }
     if (PlaceId != null)
     {
         parameters.Add("place_id", PlaceId);
     }
     if (IsCommons)
     {
         parameters.Add("is_commons", "1");
     }
     if (InGallery)
     {
         parameters.Add("in_gallery", "1");
     }
     if (IsGetty)
     {
         parameters.Add("is_getty", "1");
     }
     if (MediaType != MediaType.None)
     {
         parameters.Add("media", UtilityMethods.MediaTypeToString(MediaType));
     }
     if (GeoContext != GeoContext.NotDefined)
     {
         parameters.Add("geo_context", GeoContext.ToString("d"));
     }
     if (Faves)
     {
         parameters.Add("faves", "1");
     }
     if (PersonId != null)
     {
         parameters.Add("person_id", PersonId);
     }
     if (Camera != null)
     {
         parameters.Add("camera", Camera);
     }
     if (JumpTo != null)
     {
         parameters.Add("jump_to", JumpTo);
     }
 }
コード例 #6
0
        /// <summary>
        /// Sets the geo location for a photo.
        /// </summary>
        /// <param name="photoId">The ID of the photo to set to location for.</param>
        /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00. 
        /// Digits beyond 6 decimal places will be truncated.</param>
        /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00. 
        /// Digits beyond 6 decimal places will be truncated.</param>
        /// <param name="accuracy">The accuracy of the photos geo location.</param>
        /// <param name="context">The context of the geolocation data, i.e. Inside or Outside.</param>
        public void PhotosGeoSetLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, GeoContext context)
        {
            var parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.photos.geo.setLocation");
            parameters.Add("photo_id", photoId);
            parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
            if (accuracy != GeoAccuracy.None)
                parameters.Add("accuracy", accuracy.ToString("D"));
            if (context != GeoContext.NotDefined)
                parameters.Add("context", context.ToString("D"));

            GetResponseNoCache<NoResponse>(parameters);
        }
コード例 #7
0
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">ontext is a numeric value representing the photo's geotagginess beyond latitude and longitude. 
        /// For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        public void PhotosGeoSetContext(string photoId, GeoContext context)
        {
            var parameters = new Dictionary<string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            GetResponseNoCache<NoResponse>(parameters);
        }
コード例 #8
0
 public void PhotosGeoSetLocation(string photoId, double lat, double lon, GeoAccuracy accuracy, GeoContext context)
 {
     var dictionary = new Dictionary<string, string>();
     dictionary.Add("method", "flickr.photos.geo.setLocation");
     dictionary.Add("photo_id", photoId);
     dictionary.Add("lat", lat.ToString(NumberFormatInfo.InvariantInfo));
     dictionary.Add("lon", lon.ToString(NumberFormatInfo.InvariantInfo));
     if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d"));
     if (context != GeoContext.NotDefined) dictionary.Add("context", context.ToString("d"));
     GetResponse<NoResponse>(dictionary);
 }
コード例 #9
0
 public void PhotosGeoSetContext(string photoId, GeoContext context)
 {
     var dictionary = new Dictionary<string, string>();
     dictionary.Add("method", "flickr.photos.geo.setContext");
     dictionary.Add("photo_id", photoId);
     dictionary.Add("context", context.ToString("d"));
     GetResponse<NoResponse>(dictionary);
 }
コード例 #10
0
ファイル: Flickr_PhotosGeoAsync.cs プロジェクト: liquidboy/X
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">ontext is a numeric value representing the photo's geotagginess beyond latitude and longitude. For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public async Task<FlickrResult<NoResponse>> PhotosGeoSetContextAsync(string photoId, GeoContext context)
        {
            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            return await GetResponseAsync<NoResponse>(parameters);
        }
コード例 #11
0
        /// <summary>
        /// Indicate the state of a photo's geotagginess beyond latitude and longitude.
        /// </summary>
        /// <remarks>
        /// Note : photos passed to this method must already be geotagged (using the flickr.photos.geo.setLocation method).
        /// </remarks>
        /// <param name="photoId">The id of the photo to set context data for.</param>
        /// <param name="context">Context is a numeric value representing the photo's geotagginess beyond latitude and longitude. 
        /// For example, you may wish to indicate that a photo was taken "indoors" or "outdoors". </param>
        /// <param name="callback">Callback method to call upon return of the response from Flickr.</param>
        public void PhotosGeoSetContextAsync(string photoId, GeoContext context, Action<FlickrResult<NoResponse>> callback)
        {
            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters.Add("method", "flickr.photos.geo.setContext");
            parameters.Add("photo_id", photoId);
            parameters.Add("context", context.ToString("D"));

            GetResponseAsync<NoResponse>(parameters, callback);
        }