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