예제 #1
0
        public override bool SpinUp()
        {
            //UIUnit value = UIUnit.Create(CurrentState.EditText, DefaultMeasurementUnit, UnitPrecisionDictionary.DefaultPrecisions, IsValueInPercent);
            UIUnit value = unitConverter.CreateUIUnit(CurrentState.EditText, DefaultMeasurementUnit, IsValueInPercent);

            value++;
            if (Properties.IsWithinAllowedLimits(unitConverter.ToTwipsUnit(value, IsValueInPercent)))
            {
                Apply(value.ToString(), 0, 0, StateChangeType.Insert);
                return(false);
            }
            return(false);
        }
예제 #2
0
        public bool IsWithinAllowedLimits(string stringValue, DocumentUnit unitType, bool isValueInPercent, UIUnitConverter uiUnitConverter)
        {
            UIUnit unit     = uiUnitConverter.CreateUIUnit(stringValue, unitType, isValueInPercent);
            int    intValue = uiUnitConverter.ToTwipsUnit(unit, IsValueInPercent);

            return(IsWithinAllowedLimits(intValue));
        }