Exemplo n.º 1
0
        public SubClass Combine(SubClass Parent)
        {
            SubClass newClass = new SubClass(Parent);

            foreach (string Attribute in _DefinedAttributes)
            {
                newClass[Attribute] = this[Attribute];
            }
            return(newClass);
        }
Exemplo n.º 2
0
 private void Inherit(SubClass Parent)
 {
     if (Parent != null)
     {
         foreach (KeyValuePair <string, object> P in Parent._Attributes)
         {
             _Attributes.Add(P.Key, P.Value);
         }
     }
 }
Exemplo n.º 3
0
        public Class(ParseBlock Block)
            : this()
        {
            _Name = Block.Name;

            Dictionary <string, object> D = Block.BreakToDictionary <object>();

            if (D.ContainsKey("parent"))
            {
                Inherit((Class)D["parent"]);
                D.Remove("parent");
            }
            if (D.ContainsKey("default"))
            {
                SubClass newDefault = ((SubClass)D["default"]).Combine(_SubClasses[(int)Mode.None]);
                for (int i = 0; i < _SubClasses.Length; ++i)
                {
                    _SubClasses[i] = ((SubClass)D["default"]).Combine(_SubClasses[i]);
                }
                D.Remove("default");
            }
            if (D.ContainsKey("fade"))
            {
                _IncrementedAttributes = (List <string>)D["fade"];
                D.Remove("fade");
            }
            foreach (var KV in D)
            {
                SubClass newClass = ((SubClass)KV.Value).Combine(_SubClasses[(int)Mode.None]);
                switch (KV.Key)
                {
                case "hover": _SubClasses[(int)Mode.Hover] = newClass; break;

                case "focus": _SubClasses[(int)Mode.Focus] = newClass; break;

                case "selected": _SubClasses[(int)Mode.Selected] = newClass; break;

                case "disabled": _SubClasses[(int)Mode.Disabled] = newClass; break;

                case "selected-hover": _SubClasses[(int)Mode.SelectedHover] = newClass; break;

                case "selected-disabled": _SubClasses[(int)Mode.SelectedDisabled] = newClass; break;
                }
            }
        }
Exemplo n.º 4
0
 public SubClass(SubClass Copy)
     : this()
 {
     Inherit(Copy);
 }