CssBorderRightProperty
More information available at:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-right
using AngleSharp.Css;
using System;
using System.Collections.Generic;
using System.Linq;
namespace AngleSharp.Dom.Css
{
internal sealed class CssBorderRightProperty : CssShorthandProperty
{
internal CssBorderRightProperty(CssStyleDeclaration rule)
: base(PropertyNames.BorderRight, rule, PropertyFlags.Animatable)
{
}
protected override bool IsValid(CssValue value)
{
return CssBorderProperty.Converter.TryConvert(value, delegate(Tuple<CssValue, CssValue, CssValue> m) {
Get<CssBorderRightWidthProperty>().TrySetValue(m.Item1);
Get<CssBorderRightStyleProperty>().TrySetValue(m.Item2);
Get<CssBorderRightColorProperty>().TrySetValue(m.Item3);
});
}
internal override string SerializeValue(IEnumerable<CssProperty> properties)
{
CssBorderRightColorProperty cssBorderRightColorProperty = properties.OfType<CssBorderRightColorProperty>().FirstOrDefault();
CssBorderRightWidthProperty cssBorderRightWidthProperty = properties.OfType<CssBorderRightWidthProperty>().FirstOrDefault();
CssBorderRightStyleProperty cssBorderRightStyleProperty = properties.OfType<CssBorderRightStyleProperty>().FirstOrDefault();
if (cssBorderRightColorProperty == null || cssBorderRightWidthProperty == null || cssBorderRightStyleProperty == null)
return string.Empty;
return CssBorderProperty.SerializeValue(cssBorderRightWidthProperty, cssBorderRightStyleProperty, cssBorderRightColorProperty);
}
}
}