Exemplo n.º 1
0
 /// <summary>
 /// Add new Managed event.  No target (target assigned will be the event itself)
 /// </summary>
 /// <param name="_condition">Condition function, event will fire when condition returns true</param>
 /// <param name="_eventAction">Event Handler Action</param>
 /// <param name="_id">Optional event ID</param>
 /// <returns>Created event</returns>
 public static IEvent Add(Event.Condition _condition, Action _eventAction, string _id = null)
 {
     return(EventMgr.Add(_condition, _evt => _eventAction(), 1, Defaults.EventPriority, DESC_USER_EVENT, _id));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Add new Managed event
 /// </summary>
 /// <typeparam name="T">Target Object Type</typeparam>
 /// <param name="_target">Target Object</param>
 /// <param name="_condition">Condition function, event will fire when condition returns true</param>
 /// <param name="_eventAction">Event Handler Action with target type parameter</param>
 /// <param name="_id">Optional event ID</param>
 /// <returns>Created event</returns>
 public static IEvent Add <T>(T _target, Event.Condition _condition, Event.Handler <T> _eventAction, string _id = null)
 {
     return(EventMgr.Add(_target, _condition, _eventAction, 1, Defaults.EventPriority, DESC_USER_EVENT, _id));
 }