public void AddUiEventInterest(string key, Action <object> action) { if (UiEventsMap.ContainsKey(key)) { UiEventsMap[key] += action; } else { UiEventsMap.Add(key, action); MyView.AddUiEventListener(key, this); } }
public virtual void AddUiEventListener(string key, IMediator mediator) { IList <IMediator> mediators; if (UiEventsMap.TryGetValue(key, out mediators)) { if (!mediators.Contains(mediator)) { UiEventsMap[key].Add(mediator); } } else { UiEventsMap.Add(key, new List <IMediator> { mediator }); } }