private void SetStyle(IXLStyle style, bool propagate = false) { if (style is XLStyle xlStyle) { SetStyle(xlStyle.Value, propagate); } else { SetStyle(XLStyleValue.FromKey(XLStyle.GenerateKey(style)), propagate); } }
void IXLStylized.ModifyStyle(Func <XLStyleKey, XLStyleKey> modification) { var children = GetChildrenRecursively(this) .GroupBy(child => child.StyleValue, _comparer); foreach (var group in children) { var styleKey = modification(group.Key.Key); var styleValue = XLStyleValue.FromKey(ref styleKey); foreach (var child in group) { child.StyleValue = styleValue; } } }
public XLStyle(IXLStylized container, XLStyleKey key) : this(container, XLStyleValue.FromKey(key)) { }