本文整理汇总了C#中StringBuilder.AddFormattedParameterToQuery方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AddFormattedParameterToQuery方法的具体用法?C# StringBuilder.AddFormattedParameterToQuery怎么用?C# StringBuilder.AddFormattedParameterToQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.AddFormattedParameterToQuery方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSearchGeoQuery
public string GetSearchGeoQuery(IGeoSearchParameters parameters)
{
if (string.IsNullOrEmpty(parameters.Query) &&
string.IsNullOrEmpty(parameters.IP) &&
parameters.Coordinates == null &&
parameters.Attributes.IsNullOrEmpty())
{
throw new ArgumentException("You must provide valid coordinates, IP address, query, or attributes.");
}
var query = new StringBuilder(Resources.Geo_SearchGeo);
query.AddParameterToQuery("query", parameters.Query);
query.AddParameterToQuery("ip", parameters.IP);
if (parameters.Coordinates != null)
{
query.AddParameterToQuery("lat", parameters.Coordinates.Latitude);
query.AddParameterToQuery("long", parameters.Coordinates.Longitude);
}
foreach (var attribute in parameters.Attributes)
{
query.AddParameterToQuery(string.Format("attribute:{0}", attribute.Key), attribute.Value);
}
if (parameters.Granularity != Granularity.Undefined)
{
query.AddParameterToQuery("granularity", parameters.Granularity.ToString().ToLowerInvariant());
}
query.AddParameterToQuery("accuracy", parameters.Accuracy);
query.AddParameterToQuery("max_results", parameters.MaximumNumberOfResults);
query.AddParameterToQuery("contained_within", parameters.ContainedWithin);
query.AddParameterToQuery("callback", parameters.Callback);
query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
return query.ToString();
}
示例2: GetUpdateProfileParametersQuery
// Profile
public string GetUpdateProfileParametersQuery(IAccountUpdateProfileParameters parameters)
{
var query = new StringBuilder(Resources.Account_UpdateProfile);
query.AddParameterToQuery("name", parameters.Name);
query.AddParameterToQuery("url", parameters.Url);
query.AddParameterToQuery("location", parameters.Location);
query.AddParameterToQuery("description", parameters.Description);
query.AddParameterToQuery("profile_link_color", parameters.ProfileLinkColor);
query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
query.AddParameterToQuery("skip_status", parameters.SkipStatus);
query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
return query.ToString();
}
示例3: GetUpdateProfilBackgroundImageQuery
public string GetUpdateProfilBackgroundImageQuery(IAccountUpdateProfileBackgroundImageParameters parameters)
{
var query = new StringBuilder(Resources.Account_UpdateProfileBackgroundImage);
if (parameters.Binary == null)
{
query.AddParameterToQuery("media_id", parameters.MediaId);
}
query.AddParameterToQuery("tile", parameters.UseTileMode);
query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
query.AddParameterToQuery("skip_status", parameters.SkipStatus);
query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
return query.ToString();
}
示例4: GetUpdateProfileBannerQuery
public string GetUpdateProfileBannerQuery(IAccountUpdateProfileBannerParameters parameters)
{
var query = new StringBuilder(Resources.Account_UpdateProfileBanner);
query.AddParameterToQuery("width", parameters.Width);
query.AddParameterToQuery("height", parameters.Height);
query.AddParameterToQuery("offset_left", parameters.OffsetLeft);
query.AddParameterToQuery("offset_top", parameters.OffsetTop);
query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
return query.ToString();
}
示例5: GetUpdateProfileImageQuery
public string GetUpdateProfileImageQuery(IAccountUpdateProfileImageParameters parameters)
{
var query = new StringBuilder(Resources.Account_UpdateProfileImage);
query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
query.AddParameterToQuery("skip_status", parameters.SkipStatus);
query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters);
return query.ToString();
}