AngleSharp by Florian Rappl

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

.NET API 1,229,312 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; using System.Linq; namespace AngleSharp.Dom.Css { internal sealed class CssTextDecorationProperty : CssShorthandProperty { private static readonly IValueConverter<Tuple<CssValue, CssValue, CssValue>> Converter = Converters.WithAny(Converters.ColorConverter.Val().Option(), Converters.TextDecorationStyleConverter.Val().Option(), CssTextDecorationLineProperty.Converter.Val().Option()); internal CssTextDecorationProperty(CssStyleDeclaration rule) : base(PropertyNames.TextDecoration, rule, PropertyFlags.Animatable) { } protected override bool IsValid(CssValue value) { return Converter.TryConvert(value, delegate(Tuple<CssValue, CssValue, CssValue> m) { Get<CssTextDecorationColorProperty>().TrySetValue(m.Item1); Get<CssTextDecorationStyleProperty>().TrySetValue(m.Item2); Get<CssTextDecorationLineProperty>().TrySetValue(m.Item3); }); } internal override string SerializeValue(IEnumerable<CssProperty> properties) { CssTextDecorationColorProperty cssTextDecorationColorProperty = properties.OfType<CssTextDecorationColorProperty>().FirstOrDefault(); CssTextDecorationStyleProperty cssTextDecorationStyleProperty = properties.OfType<CssTextDecorationStyleProperty>().FirstOrDefault(); CssTextDecorationLineProperty cssTextDecorationLineProperty = properties.OfType<CssTextDecorationLineProperty>().FirstOrDefault(); if (cssTextDecorationColorProperty == null || cssTextDecorationStyleProperty == null || cssTextDecorationLineProperty == null) return string.Empty; List<string> list = new List<string>(); if (cssTextDecorationLineProperty.HasValue) list.Add(cssTextDecorationLineProperty.SerializeValue()); if (cssTextDecorationStyleProperty.HasValue) list.Add(cssTextDecorationStyleProperty.SerializeValue()); if (cssTextDecorationColorProperty.HasValue) list.Add(cssTextDecorationColorProperty.SerializeValue()); return string.Join(" ", list); } } }