Пример #1
0
 public Silenter(IEntityUpdater <T> listenerRegister, object target)
 {
     _ListenerRegister = listenerRegister;
     _Target           = target as T;
     if (_Target != null)
     {
         _ListenerRegister.OnExit(_Target);
     }
 }
Пример #2
0
        public void Dispose()
        {
            if (_Target == null)
            {
                return;
            }

            _Target.PropertyChanged -= TargetPropertyChanged;
            _ListenerRegister.OnExit(this);
            _ListenerRegister.OnEnter(_Target);
            _Target = null;
        }
Пример #3
0
        public PropertyChangedSilenter(IEntityUpdater <INotifyPropertyChanged> listenerRegister, object target, string propertyName)
        {
            _ListenerRegister = listenerRegister;
            _PropertyName     = propertyName;
            _Target           = target as INotifyPropertyChanged;
            if (_Target == null)
            {
                return;
            }

            _Target.PropertyChanged += TargetPropertyChanged;
            _ListenerRegister.OnExit(_Target);
            _ListenerRegister.OnEnter(this);
        }