示例#1
0
            public static EarListener Start(Ear <TOutput> ear, INotifyPropertyChanged target, int index)
            {
                var listener = new EarListener(ear, index);

                target.PropertyChanged += listener.TargetOnPropertyChanged;
                return(listener);
            }
示例#2
0
        private void AddListeners(int startingPoint)
        {
            var current = cache[startingPoint];

            for (var i = startingPoint; i < path.Length; i++)
            {
                var property = path[i];

                if (current is INotifyPropertyChanged target)
                {
                    var listener = EarListener.Start(this, target, i);
                    target.PropertyChanged += listener.TargetOnPropertyChanged;
                    listeners[i]            = listener;
                }

                var next = property.GetValue(current, null);
                current = next;

                if (current == null)
                {
                    break;
                }
            }
        }