public override void UnregisterAction(string actionName, PropertyChangedHandlerEx handler) { if (_actions.ContainsKey(actionName)) { _actions.Remove(actionName); } else { Logger.WarnFormat("there is not action {0}", actionName); } }
public override void RegisterAction(string actionName, PropertyChangedHandlerEx handler) { Logger.DebugFormat("Strategy {0} register an action: {1}", this.GetType().FullName, actionName); if (_parent == null) { _actions[actionName] = handler; } else { _parent.RegisterAction(actionName, handler); } }
public override void UnregisterHandler(NotifiableObject notifier, string propertyName, PropertyChangedHandlerEx changingHandler, PropertyChangedHandlerEx changedHandler) { if (notifier != null) { _registry.UnregisterHandler(notifier, propertyName, changingHandler, changedHandler); } else { Logger.ErrorFormat("Listener object is null when unregister handler"); throw new Exception("Listener object is null when unregister handler"); } }
public override void RegisterHandler(NotifiableObject notifier, string propertyName, PropertyChangedHandlerEx changingHandler, PropertyChangedHandlerEx changedHandler) { if (notifier != null) { _registry.RegisterHandler(notifier, propertyName, changingHandler, changedHandler); if (!_registered.Contains(notifier)) { notifier.PropertyChangedEx += (sender, args) => { Invoke(sender, args, PropertyChangeEvent.Changed); }; notifier.PropertyChangingEx += (sender, args) => { Invoke(sender, args, PropertyChangeEvent.Changing); }; } } else { Logger.ErrorFormat("Listener object is null when register handler"); throw new Exception("Listener object is null when register handler"); } }