CssBorderBottomProperty
More information available at:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom
using AngleSharp.Css;
using System;
using System.Collections.Generic;
using System.Linq;
namespace AngleSharp.Dom.Css
{
internal sealed class CssBorderBottomProperty : CssShorthandProperty
{
internal CssBorderBottomProperty(CssStyleDeclaration rule)
: base(PropertyNames.BorderBottom, rule, PropertyFlags.Animatable)
{
}
protected override bool IsValid(ICssValue value)
{
return CssBorderProperty.Converter.TryConvert(value, delegate(Tuple<ICssValue, ICssValue, ICssValue> m) {
Get<CssBorderBottomWidthProperty>().TrySetValue(m.Item1);
Get<CssBorderBottomStyleProperty>().TrySetValue(m.Item2);
Get<CssBorderBottomColorProperty>().TrySetValue(m.Item3);
});
}
internal override string SerializeValue(IEnumerable<CssProperty> properties)
{
CssBorderBottomColorProperty cssBorderBottomColorProperty = properties.OfType<CssBorderBottomColorProperty>().FirstOrDefault();
CssBorderBottomWidthProperty cssBorderBottomWidthProperty = properties.OfType<CssBorderBottomWidthProperty>().FirstOrDefault();
CssBorderBottomStyleProperty cssBorderBottomStyleProperty = properties.OfType<CssBorderBottomStyleProperty>().FirstOrDefault();
if (cssBorderBottomColorProperty == null || cssBorderBottomWidthProperty == null || cssBorderBottomStyleProperty == null)
return string.Empty;
return CssBorderProperty.SerializeValue(cssBorderBottomWidthProperty, cssBorderBottomStyleProperty, cssBorderBottomColorProperty);
}
}
}