AngleSharp by Florian Rappl

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

.NET API 1,174,016 bytes

 HtmlMeterElement

Represents the HTML meter element. https://html.spec.whatwg.org/multipage/forms.html#dom-meter-low
using AngleSharp.Dom.Collections; using AngleSharp.Dom.Css; using AngleSharp.Extensions; using AngleSharp.Html; using System.Globalization; namespace AngleSharp.Dom.Html { internal sealed class HtmlMeterElement : HtmlElement, ILabelabelElement, IHtmlMeterElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle { private readonly NodeList labels; public bool SupportsLabels => true; public INodeList Labels => labels; public double Value { get { return GetOwnAttribute(AttributeNames.Value).ToDouble(0).Constraint(Minimum, Maximum); } set { SetOwnAttribute(AttributeNames.Value, value.ToString(NumberFormatInfo.InvariantInfo)); } } public double Maximum { get { return GetOwnAttribute(AttributeNames.Max).ToDouble(1).Constraint(Minimum, Infinity); } set { SetOwnAttribute(AttributeNames.Max, value.ToString(NumberFormatInfo.InvariantInfo)); } } public double Minimum { get { return GetOwnAttribute(AttributeNames.Min).ToDouble(0); } set { SetOwnAttribute(AttributeNames.Min, value.ToString(NumberFormatInfo.InvariantInfo)); } } public double Low { get { return GetOwnAttribute(AttributeNames.Low).ToDouble(Minimum).Constraint(Minimum, Maximum); } set { SetOwnAttribute(AttributeNames.Low, value.ToString(NumberFormatInfo.InvariantInfo)); } } public double High { get { return GetOwnAttribute(AttributeNames.High).ToDouble(Maximum).Constraint(Low, Maximum); } set { SetOwnAttribute(AttributeNames.High, value.ToString(NumberFormatInfo.InvariantInfo)); } } public double Optimum { get { return GetOwnAttribute(AttributeNames.Optimum).ToDouble((Maximum + Minimum) * 0.5).Constraint(Minimum, Maximum); } set { SetOwnAttribute(AttributeNames.Optimum, value.ToString(NumberFormatInfo.InvariantInfo)); } } public HtmlMeterElement(Document owner, string prefix = null) : base(owner, Tags.Meter, prefix, NodeFlags.None) { labels = new NodeList(); } } }