private static void ParseWordEnumeration(string[] words, string styleValue, ref int nextIndex, Hashtable localProperties, string attributeName)
        {
            string text = HtmlCssParser.ParseWordEnumeration(words, styleValue, ref nextIndex);

            if (text != null)
            {
                localProperties[attributeName] = text;
            }
        }
        private static void ParseCssFontWeight(string styleValue, ref int nextIndex, Hashtable localProperties)
        {
            int    num  = nextIndex;
            string text = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._fontWeights, styleValue, ref num);

            if (text != null && HtmlCssParser.ParseWordEnumeration(HtmlCssParser._fontSizeUnits, styleValue, ref num) == null)
            {
                nextIndex = num;
                localProperties["font-weight"] = text;
            }
        }
 private static void ParseCssTextDecoration(string styleValue, ref int nextIndex, Hashtable localProperties)
 {
     for (int i = 1; i < HtmlCssParser._textDecorations.Length; i++)
     {
         localProperties["text-decoration-" + HtmlCssParser._textDecorations[i]] = "false";
     }
     while (nextIndex < styleValue.Length)
     {
         string text = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._textDecorations, styleValue, ref nextIndex);
         if (text == null)
         {
             break;
         }
         if (text == "none")
         {
             return;
         }
         localProperties["text-decoration-" + text] = "true";
     }
 }
        private static string ParseCssSize(string styleValue, ref int nextIndex, bool mustBeNonNegative)
        {
            HtmlCssParser.ParseWhiteSpace(styleValue, ref nextIndex);
            int num = nextIndex;

            if (nextIndex < styleValue.Length && styleValue[nextIndex] == '-')
            {
                nextIndex++;
            }
            if (nextIndex < styleValue.Length)
            {
                if (!char.IsDigit(styleValue[nextIndex]))
                {
                    if (styleValue[nextIndex] != '.')
                    {
                        goto IL_EB;
                    }
                }
                while (nextIndex < styleValue.Length && (char.IsDigit(styleValue[nextIndex]) || styleValue[nextIndex] == '.'))
                {
                    nextIndex++;
                }
                string str = styleValue.Substring(num, nextIndex - num);
                if ((nextIndex > 0 && styleValue[nextIndex - 1] == '.') || (nextIndex < styleValue.Length && styleValue[nextIndex] == ','))
                {
                    str = "0";
                }
                string text = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._fontSizeUnits, styleValue, ref nextIndex);
                if (text == null)
                {
                    text = "px";
                }
                if (mustBeNonNegative && styleValue[num] == '-')
                {
                    return("0");
                }
                return(str + text);
            }
IL_EB:
            return(null);
        }
        private static string ParseCssBorderSize(string styleValue, ref int nextIndex, bool mustBeNonNegative)
        {
            string text = HtmlCssParser.ParseCssSize(styleValue, ref nextIndex, mustBeNonNegative);

            if (text == null)
            {
                string[] words = new string[]
                {
                    "none",
                    "hidden",
                    "thin",
                    "medium",
                    "thick"
                };
                string text2 = HtmlCssParser.ParseWordEnumeration(words, styleValue, ref nextIndex);
                string a;
                if (text2 != null && (a = text2) != null)
                {
                    if (a == "none" || a == "hidden")
                    {
                        return("0px");
                    }
                    if (a == "thin")
                    {
                        return("1px");
                    }
                    if (a == "medium")
                    {
                        return("2px");
                    }
                    if (a == "thick")
                    {
                        return("3px");
                    }
                }
            }
            return(text);
        }
 private static string ParseCssBorderStyle(string styleValue, ref int nextIndex)
 {
     return(HtmlCssParser.ParseWordEnumeration(HtmlCssParser._borderStyles, styleValue, ref nextIndex));
 }
 private static void ParseCssClear(string styleValue, ref int nextIndex, Hashtable localProperties)
 {
     HtmlCssParser.ParseWordEnumeration(HtmlCssParser._clears, styleValue, ref nextIndex, localProperties, "clear");
 }
 private static void ParseCssFloat(string styleValue, ref int nextIndex, Hashtable localProperties)
 {
     HtmlCssParser.ParseWordEnumeration(HtmlCssParser._floats, styleValue, ref nextIndex, localProperties, "float");
 }
 private static void ParseCssVerticalAlign(string styleValue, ref int nextIndex, Hashtable localProperties)
 {
     HtmlCssParser.ParseWordEnumeration(HtmlCssParser._verticalAligns, styleValue, ref nextIndex, localProperties, "vertical-align");
 }
 private static void ParseCssTextTransform(string styleValue, ref int nextIndex, Hashtable localProperties)
 {
     HtmlCssParser.ParseWordEnumeration(HtmlCssParser._textTransforms, styleValue, ref nextIndex, localProperties, "text-transform");
 }
 private static string ParseCssListStylePosition(string styleValue, ref int nextIndex)
 {
     return(HtmlCssParser.ParseWordEnumeration(HtmlCssParser._listStylePositions, styleValue, ref nextIndex));
 }
        private static void ParseCssFontFamily(string styleValue, ref int nextIndex, Hashtable localProperties)
        {
            string text = null;

            while (nextIndex < styleValue.Length)
            {
                string text2 = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._fontGenericFamilies, styleValue, ref nextIndex);
                if (text2 == null)
                {
                    if (nextIndex < styleValue.Length && (styleValue[nextIndex] == '"' || styleValue[nextIndex] == '\''))
                    {
                        char c = styleValue[nextIndex];
                        nextIndex++;
                        int num = nextIndex;
                        while (nextIndex < styleValue.Length && styleValue[nextIndex] != c)
                        {
                            nextIndex++;
                        }
                        text2 = '"' + styleValue.Substring(num, nextIndex - num) + '"';
                        nextIndex++;
                    }
                    if (text2 == null)
                    {
                        int num2 = nextIndex;
                        while (nextIndex < styleValue.Length && styleValue[nextIndex] != ',' && styleValue[nextIndex] != ';')
                        {
                            nextIndex++;
                        }
                        if (nextIndex > num2)
                        {
                            text2 = styleValue.Substring(num2, nextIndex - num2).Trim();
                            if (text2.Length == 0)
                            {
                                text2 = null;
                            }
                        }
                    }
                }
                HtmlCssParser.ParseWhiteSpace(styleValue, ref nextIndex);
                if (nextIndex < styleValue.Length && styleValue[nextIndex] == ',')
                {
                    nextIndex++;
                }
                if (text2 == null)
                {
                    break;
                }
                if (text == null && text2.Length > 0)
                {
                    if (text2[0] == '"' || text2[0] == '\'')
                    {
                        text2 = text2.Substring(1, text2.Length - 2);
                    }
                    text = text2;
                }
            }
            if (text != null)
            {
                localProperties["font-family"] = text;
            }
        }
        private static string ParseCssColor(string styleValue, ref int nextIndex)
        {
            HtmlCssParser.ParseWhiteSpace(styleValue, ref nextIndex);
            string text = null;

            if (nextIndex < styleValue.Length)
            {
                int  num = nextIndex;
                char c   = styleValue[nextIndex];
                if (c == '#')
                {
                    for (nextIndex++; nextIndex < styleValue.Length; nextIndex++)
                    {
                        c = char.ToUpper(styleValue[nextIndex]);
                        if (('0' > c || c > '9') && ('A' > c || c > 'F'))
                        {
                            break;
                        }
                    }
                    if (nextIndex > num + 1)
                    {
                        text = styleValue.Substring(num, nextIndex - num);
                    }
                }
                else
                {
                    if (styleValue.Substring(nextIndex, 3).ToLower() == "rgb")
                    {
                        text = "gray";
                        while (nextIndex < styleValue.Length && styleValue[nextIndex] != ')')
                        {
                            nextIndex++;
                        }
                        if (nextIndex < styleValue.Length)
                        {
                            nextIndex++;
                        }
                        Match match = HtmlCssParser.regexRGB.Match(styleValue);
                        if (match.Success)
                        {
                            int num2 = 128;
                            int num3 = 128;
                            int num4 = 128;
                            if (int.TryParse(match.Groups["red"].ToString(), out num2) && int.TryParse(match.Groups["green"].ToString(), out num3) && int.TryParse(match.Groups["blue"].ToString(), out num4))
                            {
                                text = string.Format("#{0:X2}{1:X2}{2:X2}", num2, num3, num4);
                            }
                        }
                        else
                        {
                            match = HtmlCssParser.regexRGBA.Match(styleValue);
                            if (match.Success)
                            {
                                int    num5 = 128;
                                int    num6 = 128;
                                int    num7 = 128;
                                double num8 = 1.0;
                                if (int.TryParse(match.Groups["red"].ToString(), out num5) && int.TryParse(match.Groups["green"].ToString(), out num6) && int.TryParse(match.Groups["blue"].ToString(), out num7) && double.TryParse(match.Groups["alpha"].ToString(), out num8))
                                {
                                    text = string.Format("#{3:X2}{0:X2}{1:X2}{2:X2}", new object[]
                                    {
                                        num5,
                                        num6,
                                        num7,
                                        Math.Max(255, (int)(num8 * 255.0))
                                    });
                                }
                            }
                        }
                    }
                    else
                    {
                        if (char.IsLetter(c))
                        {
                            text = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._colors, styleValue, ref nextIndex);
                            if (text == null)
                            {
                                text = HtmlCssParser.ParseWordEnumeration(HtmlCssParser._systemColors, styleValue, ref nextIndex);
                                if (text != null)
                                {
                                    text = "black";
                                }
                            }
                        }
                    }
                }
            }
            return(text);
        }