public static string Format(object o, ESanetizationType type) { if (o == null) { return(""); } switch (type) { case ESanetizationType.UrlEncode: return(HttpUtility.UrlEncode(o.ToString())); case ESanetizationType.HtmlEncode: return(HttpUtility.HtmlEncode(o.ToString())); case ESanetizationType.UrlDecode: return(HttpUtility.UrlDecode(o.ToString())); case ESanetizationType.HtmlDecode: return(HttpUtility.HtmlDecode(o.ToString())); } return(o.ToString()); }
/// <summary> /// Constructor /// </summary> public StringSatenization() : base() { DesignBackColor = Color.BlueViolet; Sanetization = ESanetizationType.None; }