示例#1
0
        public void BindPressEvent(MultiEventObserver binder, Action <object, EventArgs> action)
        {
            var id = binder.AddNewEventAndSubscribeMethodToIt(action);

            onPressedInBind.SubscribeEventHandlerMethod("bindpress",
                                                        _ => binder.InvokeEvent(id, this, new SimpleEventArgs(_)));
            onUnbind += () => UnbindPressEvent(binder, id);
        }
示例#2
0
        private void BindTaskSelectionEvent(MultiEventObserver binder, Action <object, EventArgs> action)
        {
            var id = binder.AddNewEventAndSubscribeMethodToIt(action);

            GetOnSelectionStateChangeObserver().SubscribeEventHandlerMethod("whateverkey",
                                                                            _ => { if (_.Item3 == 0)
                                                                                   {
                                                                                       binder.InvokeEvent(id, this, new SimpleEventArgs(_.Item2));
                                                                                   }
                                                                            }, true);
        }
示例#3
0
 private void BindSelectionEvent(MultiEventObserver binder, Action <object, EventArgs> action, Unit u)
 {
     if (!trackedUnitsBinders.ContainsKey(u))
     {
         var id = binder.AddNewEventAndSubscribeMethodToIt(action);
         u.GetOnSelectionStateChangeObserver().SubscribeEventHandlerMethod("doactiontreeview",
                                                                           _ => { if (_.Item3 == 0)
                                                                                  {
                                                                                      binder.InvokeEvent(id, u, null);
                                                                                  }
                                                                           });
         trackedUnitsBinders.Add(u, binder);
     }
 }