Esempio n. 1
0
        /// <summary>
        /// Register an event with an action with a paramter
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="event"></param>
        /// <param name="body"></param>
        /// <returns></returns>
        public Emitter <T> On <T>(string @event, Action <T> body)
        {
            var e = new Emitter <T>(@event, body);

            Emitters.TryAdd(e.Event, e);

            return(e);
        }
Esempio n. 2
0
        /// <summary>
        /// Register an event with an action
        /// </summary>
        /// <param name="event"></param>
        /// <param name="body"></param>
        /// <returns></returns>
        public Emitter On(string @event, Action body)
        {
            var e = new Emitter(@event, body);

            Emitters.TryAdd(e.Event, e);

            return(e);
        }