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);
        }
Esempio n. 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));
        }
Esempio n. 3
0
 public RichTextIndentEdit()
 {
     this.batchUpdateHelper  = new BatchUpdateHelper(this);
     this.uiUnitConverter    = new UIUnitConverter(GetUnitPrecisions());
     this.valueUnitConverter = new DocumentModelUnitTwipsConverter();
     //EditValue = UIUnit.Create("0", DocumentUnit.Inch, UnitPrecisionDictionary.DefaultPrecisions); // ???
     EditValue       = uiUnitConverter.CreateUIUnit("0", Properties.DefaultUnitType);
     this.exactValue = 0;
     SubscribeEvents();
 }