// ######### // # Style # // Style Priortiy : http://www.stylish-style.com/csstec/base/order.html http://www.res-system.com/weblog/item/565 public void StyleElementWork(hglBaseBody xb) { var xe = xb.hglElement; var atrs = xe.attrib; hglStyle elementStyle = new hglStyle(xe); { elementStyle.AddParse(m_styleSheet.GetStyle("*")); } { var classname = (string)atrs["class"]; elementStyle.AddParse(m_styleSheet.GetStyle_class_tag(classname, xe)); } if (atrs == null) { return; } if (atrs.ContainsKey("style")) { elementStyle.AddParse((string)atrs["style"]); } xe.thisStyle = elementStyle; }
public void CommentWork(hglParser.Element xe) { if (xe.parent != null && xe.parent.baseBody != null) { hglBaseBody tag = (hglBaseBody)xe.parent.baseBody; tag.CommentWork(xe.text); } }
public hglBaseBody Clone() { hglBaseBody c = (hglBaseBody)System.Activator.CreateInstance(delivativeType); c.hglTags = hglTags; c.delivativeType = delivativeType; c.name = name; return(c); }
public void TextWork(hglParser.Element xe) { hglBaseBody tag = (hglBaseBody)xe.parent.baseBody; if (tag != null) { tag.TextWork(xe); } }
public void EndElementWork(hglParser.Element xe) { if (xe.baseBody != null) { var name = xe.text; hglBaseBody tag = (hglBaseBody)xe.baseBody; tag.EndElementWork(xe); tag.PostElementWork(xe); } }
public void Register(System.Type t) { hglBaseBody o = (hglBaseBody)System.Activator.CreateInstance(t); o.hglTags = m_hglTags; o.delivativeType = t; var name = t.ToString().Substring("hag_u+hglTags_html+html_".Length); o.name = name; m_tags[name] = o; }
public void ElementWork(hglParser.Element xe) { var name = xe.text; hglBaseBody work = (hglBaseBody)m_tags[name]; if (work != null) { hglBaseBody tag = work.Clone(); xe.baseBody = tag; tag.PreElementWork(xe); tag.ElementWork(xe); } }