void OnDiacriticStateChanged(AbstractProperty prop, object oldVal)
 {
   if ((bool) prop.GetValue())
   {
     // Only one diacritic can be active at a time (is this correct for all languages? -> if not, this algorithm has to be changed)
     ResetDiacritics(prop);
     // Diacritics and Alt Gr cannot be set at the same time
     AltGrState = false;
     DiacriticActive = true;
   }
   else
     DiacriticActive = CheckDiacriticActive();
 }
Esempio n. 2
0
    private void TimeTextChanged(AbstractProperty property, object oldValue)
    {
      // This message occurs, when the Time-Textbox is changed
      ILocalization localization = ServiceRegistration.Get<ILocalization>();

      // 1) test for integer
      int time;
      string textString = (string)property.GetValue();
      bool result = Int32.TryParse(textString, out time);
      if (result == false)
      {
        // not an Integer
        ErrorText = localization.ToString("[Configuration.ErrorIntegerValue]", textString);
        _hasInputError = true;
        return;
      }

      // 2) test for range
      if (time < 0 || time > _maxSleepTimeInMinutes)
      {
        // to low
        ErrorText = localization.ToString(
            (time < 0) ? "[Configuration.ErrorNumericLowerLimit]" : "[Configuration.ErrorNumericUpperLimit]",
            time, 0, _maxSleepTimeInMinutes);
        _hasInputError = true;
        return;
      }

      // 3) only rewrite, if needed
      ErrorText = string.Empty;
      _hasInputError = false;
      if (time != InitialMinutes)
        InitialMinutes = time;
    }
Esempio n. 3
0
    private void InitialMinutesChanged(AbstractProperty property, object _oldValue)
    {
      int oldValue = 0;
      if (_oldValue != null)
        oldValue = (int)_oldValue;

      if (_actSystemState.HasValue)
      {
        property.SetValue(oldValue); // no new value while running
        return;
      }

      int newValue = (int)property.GetValue();

      newValue = Math.Max(0, Math.Min(_maxSleepTimeInMinutes, newValue));
      property.SetValue(newValue);
      TimeText = newValue.ToString();
      UpdateButtonEnabled();
    }
Esempio n. 4
0
 void OnTransformChanged(AbstractProperty prop, object oldVal)
 {
   Transform oldTransform = (Transform) oldVal;
   if (oldTransform != null)
     oldTransform.ObjectChanged -= OnTransformChanged;
   Transform transform = (Transform) prop.GetValue();
   if (transform != null)
     transform.ObjectChanged += OnTransformChanged;
 }
 private void OnRefreshIntervalChanged(AbstractProperty property, object oldvalue)
 {
   _animationTimer.Interval = (double) property.GetValue();
 }
 void OnExpandedChanged(AbstractProperty property, object oldvalue)
 {
   bool expanded = (bool) property.GetValue();
   _parent.RefreshOrClearSubPathItems(_directoryItem, !expanded);
 }
Esempio n. 7
0
 protected void OnBindingValueChanged(AbstractProperty bindingValue, object oldValue)
 {
   if (_element == null)
     return;
   TriggerIfValuesEqual(bindingValue.GetValue(), Value);
 }
 void emulatorPathChangedHandler(AbstractProperty property, object oldValue)
 {
     updateConfig(property.GetValue() as string);
     updateValidStatus();
 }