public static CSSElement ParseStyleString(string css) { CSSElement result = new CSSElement(null); foreach (Match styles in StyleRegex.Matches(css)) { result.Styles.Add(new Style(styles.Groups[1].ToString(), styles.Groups[2].ToString())); } return(result); }
private void ParseStyles(string css) { foreach (Match elem in TopRegex.Matches(css)) { CSSElement styleelement = new CSSElement(elem.Groups[1].ToString()); foreach (Match styles in StyleRegex.Matches(elem.Groups[2].ToString())) { styleelement.Styles.Add(new Style(styles.Groups[1].ToString(), styles.Groups[2].ToString())); } Elements.Add(styleelement); } }