예제 #1
0
 public void Add(IElementAttribute attr, int specificity)
 {
     if (!_styles.TryGetValue(attr.Name, out var rules))
     {
         _styles.Add(attr.Name, (attr, specificity));
     }
     else if (specificity >= rules.specificity)
     {
         _styles[attr.Name] = (attr, specificity);
     }
 }
예제 #2
0
        public void Set(IElementAttribute value)
        {
            for (var i = 0; i < _attributes.Count; i++)
            {
                if (_attributes[i].Name != value.Name)
                {
                    continue;
                }
                _attributes[i] = value;
                return;
            }

            _attributes.Add(value);
        }
 public void AddCustomAttribute(IElementAttribute attribute)
 {
     _attributes[attribute.Identifier] = attribute;
 }