AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.0" />

.NET API 1,171,968 bytes

 CssTextDecorationProperty

More information available: https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
using AngleSharp.Css; using AngleSharp.Extensions; using System; using System.Collections.Generic; namespace AngleSharp.Dom.Css { internal sealed class CssTextDecorationProperty : CssShorthandProperty, ICssTextDecorationProperty, ICssProperty, ICssTextDecorationColorProperty, ICssTextDecorationLineProperty, ICssTextDecorationStyleProperty { internal static readonly IValueConverter<Tuple<ICssValue, ICssValue, ICssValue>> Converter = Converters.WithAny(CssTextDecorationColorProperty.Converter.Val().Option(), CssTextDecorationStyleProperty.Converter.Val().Option(), CssTextDecorationLineProperty.Converter.Val().Option()); private readonly CssTextDecorationColorProperty _color; private readonly CssTextDecorationLineProperty _line; private readonly CssTextDecorationStyleProperty _style; public TextDecorationStyle DecorationStyle => _style.DecorationStyle; public IEnumerable<TextDecorationLine> Lines => _line.Lines; public Color Color => _color.Color; internal CssTextDecorationProperty(CssStyleDeclaration rule) : base(PropertyNames.TextDecoration, rule, PropertyFlags.Animatable) { _color = Get<CssTextDecorationColorProperty>(); _line = Get<CssTextDecorationLineProperty>(); _style = Get<CssTextDecorationStyleProperty>(); } protected override bool IsValid(ICssValue value) { return Converter.TryConvert(value, delegate(Tuple<ICssValue, ICssValue, ICssValue> m) { _color.TrySetValue(m.Item1); _style.TrySetValue(m.Item2); _line.TrySetValue(m.Item3); }); } internal override string SerializeValue(IEnumerable<CssProperty> properties) { if (!IsComplete(properties)) return string.Empty; return string.Format("{0} {1} {2}", new object[3] { _line.SerializeValue(), _style.SerializeValue(), _color.SerializeValue() }); } } }