public void Should_Render_A_Flip_Icon(IconFlip iconFlip, string expected)
        {
            Icon icon = Far.Adjust;

            icon
            .Flip(iconFlip)
            .ToIcon().Should().Be(expected);
        }
        public void Should_Render_A_Flip_Icon(IconFlip iconFlip, string expected)
        {
            var icon = _host.RenderComponent <FaIcon>(
                builder => builder
                .Parameter(x => x.Icon, Far.Adjust)
                .Parameter(x => x.Flip, iconFlip)
                );

            icon.Markup.Should().Be(expected);
        }
        public override double Convert(
            IconFlip iconFlip,
            ConverterParam <string> propertyParam)
        {
            var x = 0;
            var y = 0;

            switch (iconFlip)
            {
            case IconFlip.None:
            {
                x = 1;
                y = 1;
                break;
            }

            case IconFlip.Horizontal:
            {
                x = -1;
                y = 1;
                break;
            }

            case IconFlip.Vertial:
            {
                x = 1;
                y = -1;
                break;
            }

            case IconFlip.Both:
            {
                x = -1;
                y = -1;
                break;
            }

            default:
                throw new ArgumentOutOfRangeException();
            }
            switch (propertyParam.Value)
            {
            case "X":
                return(x);

            case "Y":
                return(y);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#4
0
 private Icon(
     IconStyle style,
     string name,
     IconSize iconSize,
     bool fixedWidth,
     bool spin,
     bool pulse,
     IconPull pull,
     bool border,
     bool inverse,
     double grow,
     double shrink,
     double up,
     double down,
     double left,
     double right,
     double rotate,
     IconFlip flip,
     Icon?mask,
     string?cssClass,
     string?cssStyle
     )
 {
     Style       = style;
     Name        = name;
     _size       = iconSize;
     _fixedWidth = fixedWidth;
     _spin       = spin;
     _pulse      = pulse;
     _pull       = pull;
     _border     = border;
     _inverse    = inverse;
     _grow       = grow;
     _shrink     = shrink;
     _up         = up;
     _down       = down;
     _left       = left;
     _right      = right;
     _rotate     = rotate;
     _flip       = flip;
     _mask       = mask;
     _cssClass   = cssClass;
     _cssStyle   = cssStyle;
 }