Exemplo n.º 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;
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
        public hglBaseBody Clone()
        {
            hglBaseBody c = (hglBaseBody)System.Activator.CreateInstance(delivativeType);

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

            if (tag != null)
            {
                tag.TextWork(xe);
            }
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
            }
        }