public FullListenerRegister(Action <INotifyPropertyChanged> propertyOn, Action <INotifyPropertyChanged> propertyOff, Action <INotifyCollectionChanged> collectionOn, Action <INotifyCollectionChanged> collectionOff, Action <JSCommand> jsCommandOn, Action <JSCommand> jsCommandOff) { Property = new ListenerRegister <INotifyPropertyChanged>(propertyOn, propertyOff); Collection = new ListenerRegister <INotifyCollectionChanged>(collectionOn, collectionOff); Command = new ListenerRegister <JSCommand>(jsCommandOn, jsCommandOff); }
public Silenter(ListenerRegister <T> listenerRegister, object target) { _ListenerRegister = listenerRegister; _Target = target as T; if (_Target != null) { _ListenerRegister.Off(_Target); } }
private FullListenerRegister(Action <INotifyPropertyChanged> propertyOn, Action <INotifyPropertyChanged> propertyOff, Action <INotifyCollectionChanged> collectionOn, Action <INotifyCollectionChanged> collectionOff, Action <JsCommandBase> jsCommandOn, Action <JsCommandBase> jsCommandOff) { Property = new ListenerRegister <INotifyPropertyChanged>(propertyOn, propertyOff); Collection = new ListenerRegister <INotifyCollectionChanged>(collectionOn, collectionOff); Command = new ListenerRegister <JsCommandBase>(jsCommandOn, jsCommandOff); On = new ObjectChangesListener(Property.OnEnter, Collection.OnEnter, Command.OnEnter); Off = new ObjectChangesListener(Property.OnExit, Collection.OnExit, Command.OnExit); }
public ListenerUpdater(IJsUpdaterFactory jsUpdaterFactory) { _JsUpdaterFactory = jsUpdaterFactory; _JsUpdaterFactory.OnJavascriptSessionReady += _JsUpdaterFactory_OnJavascriptSessionReady; _Property = new ListenerRegister <INotifyPropertyChanged>(n => n.PropertyChanged += OnCSharpPropertyChanged, n => n.PropertyChanged -= OnCSharpPropertyChanged); _Collection = new ListenerRegister <INotifyCollectionChanged>(n => n.CollectionChanged += OnCSharpCollectionChanged, n => n.CollectionChanged -= OnCSharpCollectionChanged); var command = new ListenerRegister <ICommand>(c => c.CanExecuteChanged += OnCommandCanExecuteChanged, c => c.CanExecuteChanged -= OnCommandCanExecuteChanged); var updatableCommand = new ListenerRegister <IUpdatableCommand>(c => c.CanExecuteChanged += OnCommandCanExecuteChanged, c => c.CanExecuteChanged -= OnCommandCanExecuteChanged); On = new ObjectChangesListener(_Property.OnEnter, _Collection.OnEnter, command.OnEnter, updatableCommand.OnEnter); Off = new ObjectChangesListener(_Property.OnExit, _Collection.OnExit, command.OnExit, updatableCommand.OnExit); }
public DeltaListener(ListenerRegister <T> listenerRegister) { _ListenerRegister = listenerRegister; }
public void Apply(ListenerRegister <T> listenerRegister) { _Old.Where(o => !_New.Contains(o)).ForEach(listenerRegister.Off); _New.Where(o => !_Old.Contains(o)).ForEach(listenerRegister.On); }