/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p"> Параметры. </param> /// <returns> </returns> public static VkParameters ToVkParameters(PhotoSearchParams p) { var parameters = new VkParameters { { "q", p.Query } , { "lat", p.Latitude } , { "long", p.Longitude } , { "start_time", p.StartTime } , { "end_time", p.EndTime } , { "sort", p.Sort } , { "offset", p.Offset } , { "count", p.Count } , { "radius", p.Radius } }; return(parameters); }
/// <summary> /// Привести к типу VkParameters. /// </summary> /// <param name="p">Параметры.</param> /// <returns></returns> internal static VkParameters ToVkParameters(PhotoSearchParams p) { var parameters = new VkParameters { { "q", HttpUtility.UrlEncode(p.Query) }, { "lat", p.Latitude }, { "long", p.Longitude }, { "start_time", p.StartTime }, { "end_time", p.EndTime }, { "sort", p.Sort }, { "offset", p.Offset }, { "count", p.Count }, { "radius", p.Radius } }; return parameters; }
public ReadOnlyCollection<Photo> Search(out int count, PhotoSearchParams @params) { var response = Search(@params); count = Convert.ToInt32(response.TotalCount); return response.ToReadOnlyCollection(); }
public ReadOnlyCollection<Photo> Search(out int count,PhotoSearchParams @params) { var response = _vk.Call("photos.search", @params, true); count = response["count"]; return response["items"].ToReadOnlyCollectionOf<Photo>(x => x); }