示例#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 AddParse(string s)
        {
            if (string.IsNullOrEmpty(s))
            {
                return;
            }
            hglStyle tmpStyle = new hglStyle(null);

            tmpStyle.Parse(s);

            CopyFrom(tmpStyle, false);
        }
示例#3
0
        private void CopyFrom(hglStyle src, bool reset /*=false*/)
        {
            if (reset)
            {
                m_hash.Clear();
            }

            if (src != null)
            {
                foreach (var k in src.m_hash.Keys)
                {
                    m_hash[k] = src.m_hash[k];
                }
            }
        }
示例#4
0
            public object tmp4;               //For any work. Use only local!
#endif
            public Element()
            {
                mode      = Mode.NONE;
                selfClose = false;
                text      = "";
                parent    = null;
                //end = false;
                children = null;
#if __UNITY
                thisStyle        = new hglStyle(this);
                _colorIndex      = -1;
                backcolorIndex   = -1;
                effectColorIndex = -1;
                frameColorIndex  = -1;

                bone1 = null;
                bone2 = null;
#endif
            }