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); }
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)); }