private void UpdateValue() { var value = _baseValue; foreach (var modifier in _modifiers.OrderBy(x => x.Priority)) { value = modifier.Apply(value); } if (!Value.Equals(value)) { Value = value; OnCharacteristicChanged(value, Value); } }
private void UpdateValue() { var oldValue = _currentValue.Value; var newValue = _baseValue.Value; foreach (var modifier in _modifiers.OrderBy(x => x.Priority)) { newValue = modifier.Apply(newValue); } if (!oldValue.Equals(newValue)) { Value = newValue; Changed.Raise(new CharacteristicChangedParams <T>(oldValue, newValue)); OnCharacteristicChanged(oldValue, newValue); } }