Пример #1
0
        /// <summary>
        /// Convert between different units of screen resolutions.
        /// </summary>
        /// <param name="inputUnit"></param>
        /// <param name="inputValue"></param>
        /// <param name="outputUnit"></param>
        /// <returns></returns>
        public override double Convert(Itemkey inputUnit, double inputValue, Itemkey outputUnit)
        {
            switch (inputUnit)
            {
            case Itemkey.ScreenFontPoints:
                return(ScreenFontPoints.ToUnit(inputValue, outputUnit, OneHundredPercentFontSize));

            case Itemkey.ScreenPercent:
                return(ScreenPercent.ToUnit(inputValue, outputUnit, OneHundredPercentFontSize));

            default:
                throw new NotImplementedException(outputUnit.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// Convert percentage unit based value into another unit based value.
        /// </summary>
        /// <param name="inputValue"></param>
        /// <param name="targetUnit"></param>
        /// <returns></returns>
        public static double ToUnit(double inputValue, Itemkey targetUnit)
        {
            ScreenPercent d = new ScreenPercent(inputValue);

            return(d.ToUnit(targetUnit));
        }
Пример #3
0
        /// <summary>
        /// Convert percentage unit based value into another unit based value.
        /// </summary>
        /// <param name="inputValue"></param>
        /// <param name="targetUnit"></param>
        /// <returns></returns>
        public static double ToUnit(double inputValue, Itemkey targetUnit)
        {
            ScreenPercent d = new ScreenPercent(inputValue);

              return d.ToUnit(targetUnit);
        }