protected override void SetRightValue(INotifyReversableExpression <long> right, long left, long result) { if (left - right.Value != result) { right.Value = left - result; } }
protected override void SetRightValue(INotifyReversableExpression <uint> right, uint left, uint result) { if (left / right.Value != result) { right.Value = left / result; } }
protected override void SetLeftValue(INotifyReversableExpression <float> left, float right, float result) { if (left.Value / right != result) { left.Value = right * result; } }
protected override void SetLeftValue(INotifyReversableExpression <int> left, int right, int result) { if (left.Value + right != result) { left.Value = result - right; } }
protected override void SetRightValue(INotifyReversableExpression <int> right, int left, int result) { if (left + right.Value != result) { right.Value = result - left; } }
protected override void SetRightValue(INotifyReversableExpression <TRight> right, TLeft left, TResult result) { if (leftReverser != null) { right.Value = leftReverser(result, left); } }
protected override void SetLeftValue(INotifyReversableExpression <TLeft> left, TRight right, TResult result) { if (rightReverser != null) { left.Value = rightReverser(result, right); } }
protected override void SetRightValue(INotifyReversableExpression <double> right, double left, double result) { if (left - right.Value != result) { right.Value = left - result; } }
protected override void SetRightValue(INotifyReversableExpression <float> right, float left, float result) { if (left - right.Value != result) { right.Value = left - result; } }
public ObservableReversablePropertyMemberBinding(INotifyExpression <T> target, string memberName, Func <T, TMember> memberGet, Action <T, TMember> memberSet, INotifyReversableExpression <TMember> value) { if (value == null) { throw new ArgumentNullException("value"); } if (memberName == null) { throw new ArgumentNullException("memberName"); } if (memberGet == null) { throw new ArgumentNullException("memberGet"); } if (memberSet == null) { throw new ArgumentNullException("memberSet"); } if (target == null) { throw new ArgumentNullException("target"); } Value = value; MemberName = memberName; MemberGet = memberGet; MemberSet = memberSet; Target = target; listener = new PropertyChangeListener(this); }
protected override void SetLeftValue(INotifyReversableExpression <long> left, long right, long result) { if (left.Value - right != result) { left.Value = right + result; } }
protected override void SetLeftValue(INotifyReversableExpression <double> left, double right, double result) { if (left.Value * right != result) { left.Value = result / right; } }
protected override void SetRightValue(INotifyReversableExpression <string> right, string left, string result) { if (string.IsNullOrEmpty(left)) { right.Value = result; } else if (left + right.Value != result && result != null && result.StartsWith(left)) { right.Value = result.Substring(left.Length); } }
protected override void SetLeftValue(INotifyReversableExpression <string> left, string right, string result) { if (string.IsNullOrEmpty(right)) { left.Value = result; } else if (left.Value + right != result && result != null && result.EndsWith(right)) { left.Value = result.Substring(0, result.Length - right.Length); } }
private void Coalesce(INotifyReversableExpression <IModelElement> coalesceValue) { if (ReferencedElement == null) { ReferencedElement = coalesceValue; } else { ReferencedElement = Observable.Coalesce(ReferencedElement, coalesceValue); } }
private void Coalesce(INotifyReversableExpression<object> coalesceValue) { if (Value == null) { Value = coalesceValue; } else { Value = Observable.Coalesce(Value, coalesceValue); } }
protected override void SetValue(INotifyReversableExpression <TInner> inner, TOuter value) { try { inner.Value = (TInner)System.Convert.ChangeType(value, typeof(TInner)); } catch (InvalidCastException ex) { // Swallow Debug.WriteLine("Cast failed: " + ex.Message); } }
internal NotifyReversableValue(INotifyReversableExpression <T> expression) { if (expression == null) { throw new ArgumentNullException("expression"); } Expression = expression; Successors.Attached += (obj, e) => Attach(); Successors.Detached += (obj, e) => Detach(); }
internal NotifyReversableValue(INotifyReversableExpression <T> expression) { if (expression == null) { throw new ArgumentNullException("expression"); } Expression = expression; if (!expression.IsAttached) { expression.Attach(); } expression.ValueChanged += ExpressionValueChanged; }
protected abstract void SetValue(INotifyReversableExpression <TInner> inner, TOuter value);
protected override void SetValue(INotifyReversableExpression <double> inner, double value) { inner.Value = -value; }
protected override void SetValue(INotifyReversableExpression <decimal> inner, decimal value) { inner.Value = -value; }
public ObservableReversableBoxExpression(INotifyReversableExpression <T> inner) : base(inner) { }
protected override void SetValue(INotifyReversableExpression <float> inner, float value) { inner.Value = -value; }
protected override void SetValue(INotifyReversableExpression <long> inner, long value) { inner.Value = -value; }
protected abstract void SetRightValue(INotifyReversableExpression <TRight> right, TLeft left, TResult result);
protected override void SetLeftValue(INotifyReversableExpression <uint> left, uint right, uint result) { left.Value = right ^ result; }
protected override void SetRightValue(INotifyReversableExpression <int> right, int left, int result) { right.Value = left ^ result; }
protected override void SetRightValue(INotifyReversableExpression <ulong> right, ulong left, ulong result) { right.Value = left ^ result; }
public ObservableReversableCoalesceExpression(INotifyReversableExpression <T> left, INotifyReversableExpression <T> right) : base(left, right) { }