Example #1
0
 /// <summary>
 /// Add a GangEventHandler
 /// </summary>
 /// <typeparam name="TData">Type of data</typeparam>
 /// <param name="GangEventHandler">A GangEventHandler</param>
 /// <returns>A new Executor</returns>
 public GangEventExecutor <TDataImplements> AddHandler <TData>(IGangEventHandler <TData> GangEventHandler)
     where TData : class, TDataImplements
 {
     return(new GangEventExecutor <TDataImplements>(
                _allHandlers.Add(GangEventHandler <TDataImplements> .From(GangEventHandler))
                ));
 }
Example #2
0
 /// <summary>
 /// Add a delegate/method as a GangEventHandler
 /// </summary>
 /// <typeparam name="TData">Type of data</typeparam>
 /// <param name="handle">Handle delegate/method</param>
 /// <returns>A new Executor</returns>
 public GangEventExecutor <TDataImplements> AddHandler <TData>(Func <TData, Task> handle)
     where TData : class, TDataImplements
 {
     return(new GangEventExecutor <TDataImplements>(
                _allHandlers.Add(GangEventHandler <TDataImplements> .From(handle))
                ));
 }