Наследование: System.Collections.Hashtable
Пример #1
0
        /**
         * Converts a <CODE>BaseColor</CODE> into a HTML representation of this <CODE>
         * BaseColor</CODE>.
         *
         * @param s
         *            the <CODE>BaseColor</CODE> that has to be converted.
         * @return the HTML representation of this <COLOR>BaseColor </COLOR>
         */

        public static BaseColor DecodeColor(String s)
        {
            if (s == null)
            {
                return(null);
            }
            s = s.ToLowerInvariant().Trim();
            try {
                return(WebColors.GetRGBColor(s));
            }
            catch {
                return(null);
            }
        }
Пример #2
0
 /// <summary>
 /// Converts a <CODE>Color</CODE> into a HTML representation of this <CODE>Color</CODE>.
 /// </summary>
 /// <param name="color">the <CODE>Color</CODE> that has to be converted.</param>
 /// <returns>the HTML representation of this <CODE>Color</CODE></returns>
 public static Color DecodeColor(String s)
 {
     if (s == null)
     {
         return(null);
     }
     s = s.ToLower(CultureInfo.InvariantCulture).Trim();
     try {
         return(WebColors.GetRGBColor(s));
     }
     catch {
     }
     return(null);
 }