/// <summary> /// The param text. /// </summary> /// <param name="argument"> /// The argument. /// </param> /// <returns> /// The param text string. /// </returns> public static string ParamText(WebPurifyArgument argument) { switch (argument) { case WebPurifyArgument.ApiKey: return("api_key"); case WebPurifyArgument.CDataWrap: return("cdata"); case WebPurifyArgument.CheckEmail: return("semail"); case WebPurifyArgument.CheckPhone: return("sphone"); case WebPurifyArgument.Language: return("lang"); case WebPurifyArgument.ListWord: return("word"); case WebPurifyArgument.ReplaceSymbol: return("replacesymbol"); case WebPurifyArgument.Text: return("text"); default: return(string.Empty); } }
/// <summary> /// The add param. /// </summary> /// <param name="url"> /// The url. /// </param> /// <param name="argument"> /// The argument. /// </param> /// <param name="value"> /// The value. /// </param> /// <returns> /// adds a querystring parameter to the url /// </returns> public static string AddParam(this string url, WebPurifyArgument argument, string value) { return(url + "&" + ParamText(argument) + "=" + value.Trim()); }
/// <summary> /// The add param. /// </summary> /// <param name="url"> /// The url. /// </param> /// <param name="argument"> /// The argument. /// </param> /// <param name="value"> /// The value. /// </param> /// <returns> /// adds a querystring parameter to the url /// </returns> public static string AddParam(this string url, WebPurifyArgument argument, string value) { return url + "&" + ParamText(argument) + "=" + value.Trim().ToEncodedUrl(); }
/// <summary> /// The param text. /// </summary> /// <param name="argument"> /// The argument. /// </param> /// <returns> /// The param text string. /// </returns> public static string ParamText(WebPurifyArgument argument) { switch (argument) { case WebPurifyArgument.ApiKey: return "api_key"; case WebPurifyArgument.CDataWrap: return "cdata"; case WebPurifyArgument.CheckEmail: return "semail"; case WebPurifyArgument.CheckPhone: return "sphone"; case WebPurifyArgument.Language: return "lang"; case WebPurifyArgument.ListWord: return "word"; case WebPurifyArgument.ReplaceSymbol: return "replacesymbol"; case WebPurifyArgument.Text: return "text"; default: return string.Empty; } }