Beispiel #1
0
        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());
        }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public StringSatenization() : base()
 {
     DesignBackColor = Color.BlueViolet;
     Sanetization    = ESanetizationType.None;
 }