AngleSharp by Florian Rappl

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

.NET API 1,229,312 bytes

 CssListStyleProperty

More information available at https://developer.mozilla.org/en-US/docs/Web/CSS/list-style
using AngleSharp.Css; using AngleSharp.Extensions; using System; using System.Collections.Generic; using System.Linq; namespace AngleSharp.Dom.Css { internal sealed class CssListStyleProperty : CssShorthandProperty { private static readonly IValueConverter<Tuple<CssValue, CssValue, CssValue>> Converter = Converters.WithAny(Converters.ListStyleConverter.Val().Option().Val(), Converters.ListPositionConverter.Val().Option().Val(), Converters.OptionalImageSourceConverter.Val().Option().Val()); internal CssListStyleProperty(CssStyleDeclaration rule) : base(PropertyNames.ListStyle, rule, PropertyFlags.Inherited) { } protected override bool IsValid(CssValue value) { return Converter.TryConvert(value, delegate(Tuple<CssValue, CssValue, CssValue> m) { Get<CssListStyleTypeProperty>().TrySetValue(m.Item1); Get<CssListStylePositionProperty>().TrySetValue(m.Item2); Get<CssListStyleImageProperty>().TrySetValue(m.Item3); }); } internal override string SerializeValue(IEnumerable<CssProperty> properties) { CssListStyleTypeProperty cssListStyleTypeProperty = properties.OfType<CssListStyleTypeProperty>().FirstOrDefault(); CssListStylePositionProperty cssListStylePositionProperty = properties.OfType<CssListStylePositionProperty>().FirstOrDefault(); CssListStyleImageProperty cssListStyleImageProperty = properties.OfType<CssListStyleImageProperty>().FirstOrDefault(); if (cssListStyleTypeProperty == null || cssListStylePositionProperty == null || cssListStyleImageProperty == null) return string.Empty; List<string> list = new List<string>(); if (cssListStyleTypeProperty.HasValue) list.Add(cssListStyleTypeProperty.SerializeValue()); if (cssListStyleImageProperty.HasValue) list.Add(cssListStyleImageProperty.SerializeValue()); if (cssListStylePositionProperty.HasValue) list.Add(cssListStylePositionProperty.SerializeValue()); return string.Join(" ", list); } } }