public NamedThickness(ExetendedNamedSize left, ExetendedNamedSize top, ExetendedNamedSize right, ExetendedNamedSize bottom)
 {
     Top    = SXF.GetUnitSize(top);
     Left   = SXF.GetUnitSize(left);
     Right  = SXF.GetUnitSize(right);
     Bottom = SXF.GetUnitSize(bottom);
 }
Ejemplo n.º 2
0
        private static double GetSize(ExetendedNamedSize size, bool font)
        {
            var    baseunit    = font ? DefaultFontSize : DefaultUnitSize;
            double baseSpacing = Device.GetNamedSize(NamedSize.Large, typeof(Label)) - Device.GetNamedSize(NamedSize.Medium, typeof(Label));
            var    unitSpacing = font ? baseSpacing : DefaultUnitSize / 2;

            switch (size)
            {
            case ExetendedNamedSize.Default:
                return(baseunit);

            case ExetendedNamedSize.XSmall:
                return(baseunit - unitSpacing * 2);

            case ExetendedNamedSize.xSmall:
                return(baseunit - unitSpacing * 1.5);

            case ExetendedNamedSize.Small:
                return(baseunit - unitSpacing);

            case ExetendedNamedSize.Normal:
                return(baseunit);

            case ExetendedNamedSize.Large:
                return(baseunit + unitSpacing);

            case ExetendedNamedSize.xLarge:
                return(baseunit + unitSpacing * 1.5);

            case ExetendedNamedSize.XLarge:
                return(baseunit + unitSpacing * 2);

            case ExetendedNamedSize.xxLarge:
                return(baseunit + unitSpacing * 2.5);

            case ExetendedNamedSize.XXLarge:
                return(baseunit + unitSpacing * 3);

            case ExetendedNamedSize.Zero:
                return(0);

            default:
                return(baseunit);
            }
        }
Ejemplo n.º 3
0
 public static double GetUnitSize(ExetendedNamedSize size) => GetSize(size, false);
Ejemplo n.º 4
0
 public static double GetFontSize(ExetendedNamedSize size) => GetSize(size, true);
 public NamedThickness(ExetendedNamedSize horizontalSize, ExetendedNamedSize verticalSize) : this(horizontalSize, verticalSize, horizontalSize, verticalSize)
 {
 }
 public NamedThickness(ExetendedNamedSize uniformSize) : this(uniformSize, uniformSize, uniformSize, uniformSize)
 {
 }