public override INotificationResult Notify(IList <INotificationResult> sources)
 {
     if (sources.Count > 0)
     {
         var oldValue = ((IValueChangedNotificationResult)sources[0]).OldValue;
         listener.Unsubscribe();
         AttachPropertyChangeListener(Target.Value);
     }
     return(base.Notify(sources));
 }
Пример #2
0
        public override INotificationResult Notify(IList <INotificationResult> sources)
        {
            IValueChangedNotificationResult <T> targetChange = null;

            if (sources.Count >= 1 && sources[0].Source == Target)
            {
                targetChange = sources[0] as IValueChangedNotificationResult <T>;
            }
            else if (sources.Count == 2 && sources[1].Source == Target)
            {
                targetChange = sources[1] as IValueChangedNotificationResult <T>;
            }

            if (targetChange != null)
            {
                listener.Unsubscribe();
                AttachPropertyChangeListener(targetChange.NewValue);
            }

            Apply();
            Value.Value = MemberGet(Target.Value);
            return(new ValueChangedNotificationResult <T>(this, targetChange.OldValue, targetChange.NewValue));
        }
Пример #3
0
 public Entry()
 {
     listener             = new PropertyChangeListener(this);
     Successors.Attached += (obj, e) => listener.Subscribe(this, "Value");
     Successors.Detached += (obj, e) => listener.Unsubscribe();
 }