コード例 #1
0
        public static IDistance ToBorderSlice(this CSSValue value)
        {
            var percent = value.ToPercent();

            if (percent.HasValue)
            {
                return(percent.Value);
            }

            var number = value.ToSingle();

            if (number.HasValue)
            {
                return(new Length(number.Value, Length.Unit.Px));
            }

            return(null);
        }
コード例 #2
0
        static SliceMode ToMode(CSSValue value)
        {
            var percent = value.ToPercent();

            if (percent.HasValue)
            {
                return(new PercentSliceMode(percent.Value));
            }

            var number = value.ToNumber();

            if (number.HasValue)
            {
                return(new PixelSliceMode(number.Value));
            }

            return(null);
        }