Exemplo n.º 1
0
 public void SendEvent(TEPath path, TireEventType type, System.Object param)
 {
     Tire.SendEvent(type, param);
     if (path == TEPath.Local)
     {
     }
     else if(path == TEPath.Up)
     {
         Parent.SendEvent(path, type, param);
     }
     else if(path == TEPath.Down)
     {
         foreach(var child in Children)
         {
             child.SendEvent(path, type, param);
         }
     }
     else if(path == TEPath.UpDown)
     {
         Parent.SendEvent(TEPath.Up, type, param);
         foreach (var child in Children)
         {
             child.SendEvent(TEPath.Down, type, param);
         }
     }
 }
Exemplo n.º 2
0
 public void RemoveEventListener(TireEventType type, Action<object> handler)
 {
     var handlersList = HandlersMap[type];
     if (handlersList == null)
     {
         handlersList.Remove(handler);
     }
 }
Exemplo n.º 3
0
 public void AddEventListener(TireEventType type, Action<object> handler)
 {
     var handlersList = HandlersMap[type];
     if(handlersList == null)
     {
         handlersList = new HashSet<Action<System.Object>>();
         HandlersMap[type] = handlersList;
     }
     handlersList.Add(handler);
 }
Exemplo n.º 4
0
 public void SendEvent(TireEventType type, Object param)
 {
     var handlersList = HandlersMap[type];
     if (handlersList == null)
     {
         foreach (var handler in handlersList)
         {
             handler(param);
         }
     }
 }
Exemplo n.º 5
0
 public void RemoveEventListener(TireEventType type, Action<System.Object> handler)
 {
     Tire.RemoveEventListener(type, handler);
 }