public static EarListener Start(Ear <TOutput> ear, INotifyPropertyChanged target, int index) { var listener = new EarListener(ear, index); target.PropertyChanged += listener.TargetOnPropertyChanged; return(listener); }
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; } } }