Ejemplo n.º 1
0
 public void AddUiEventInterest(string key, Action <object> action)
 {
     if (UiEventsMap.ContainsKey(key))
     {
         UiEventsMap[key] += action;
     }
     else
     {
         UiEventsMap.Add(key, action);
         MyView.AddUiEventListener(key, this);
     }
 }
Ejemplo n.º 2
0
        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
                });
            }
        }