public CssStyleList ListAllCssStyle(string tagName) { CssStyleList retVal = new CssStyleList(); for (Int32 i = 0; i < this[tagName].cssStyles.Count; i++) { retVal.Add(this[tagName].cssStyles[i]); } for (Int32 i = 0; i < this[CssHeaderStyleType.UnspecifiedTagName].cssStyles.Count; i++) { retVal.Add(this[CssHeaderStyleType.UnspecifiedTagName].cssStyles[i]); } return(retVal); }
/// <summary> /// update curState based on loaded cssStyle /// </summary> internal void ApplyCssStyle(HtmlTag applyTag, ref CurrentStateType curState, bool loadNonInherited) { if (applyTag.StartTag()) { CssStyleList sList = styleList.ListAllCssStyle(applyTag.name); foreach (CssStyleType style in sList) { if (matchTag(style, applyTag)) { loadStyle(style, ref curState, loadNonInherited); } } if (applyTag.variables.Contains("style") && (applyTag.variables["style"].value != "")) { ArrayList aList = Utils.DecodeCssStyle(applyTag.name + " {" + applyTag.variables["style"].value + "}"); foreach (CssStyleType style in aList) { //if (matchTag(style, applyTag)) loadStyle(style, ref curState, loadNonInherited); } // if (aList.Count > 0) // { // CssStyleType item = aList[0]; // foreach (CssStyleType style in item.styles) // if (matchTag(style, applyTag)) // loadStyle(style, ref curState, loadNonInherited); // // } } } }
public TagCssStyleType(string aTagName) : base() { tagName = aTagName; cssStyles = new CssStyleList(); }
public CssStyleList ListAllCssStyle(string tagName) { CssStyleList retVal = new CssStyleList(); for (Int32 i = 0; i < this[tagName].cssStyles.Count; i++) retVal.Add(this[tagName].cssStyles[i]); for (Int32 i = 0; i < this[CssHeaderStyleType.UnspecifiedTagName].cssStyles.Count; i++) retVal.Add(this[CssHeaderStyleType.UnspecifiedTagName].cssStyles[i]); return retVal; }