public StyleContainer Compute(AbstractElement element) { BitArray array; lock (computedStyles) { if (selectorCount < 0) { selectorCount = styles.Count(); } array = new BitArray(selectorCount); } int index = 0; foreach (var container in styles) { array.Set(index++, container.Selector.Matches(element)); } if (computedStyles.TryGetValue(array, out var computedContainer)) { return(computedContainer); } else { var container = new StyleContainer(AllStyleSelector.Singleton); foreach (var styleContainer in styles) { if (styleContainer.Selector.Matches(element)) { foreach (var(key, value) in styleContainer) { container.Set(key, value); } } } computedStyles[array] = container; return(container); } }
public abstract void Set(StyleContainer style, [DisallowNull] T value);
public override void Set(StyleContainer style, [DisallowNull] T value) { Setter(style, value); }
public override void Set(StyleContainer style, [DisallowNull] T value) { style.Set(Name, value); }