示例#1
0
        // #########
        // # 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;
        }
示例#2
0
 public void CommentWork(hglParser.Element xe)
 {
     if (xe.parent != null && xe.parent.baseBody != null)
     {
         hglBaseBody tag = (hglBaseBody)xe.parent.baseBody;
         tag.CommentWork(xe.text);
     }
 }
示例#3
0
        public hglBaseBody Clone()
        {
            hglBaseBody c = (hglBaseBody)System.Activator.CreateInstance(delivativeType);

            c.hglTags        = hglTags;
            c.delivativeType = delivativeType;
            c.name           = name;
            return(c);
        }
示例#4
0
        public void TextWork(hglParser.Element xe)
        {
            hglBaseBody tag = (hglBaseBody)xe.parent.baseBody;

            if (tag != null)
            {
                tag.TextWork(xe);
            }
        }
示例#5
0
 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);
     }
 }
示例#6
0
        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;
        }
示例#7
0
        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);
            }
        }