private IEnumerator <Params> NewAfter(Params ps, IEnumerator <Params> prevRoutine, Func <Params, HandlerFuture> genNextHandler)
 {
     while (true)
     {
         prevRoutine.MoveNext();
         if (prevRoutine.Current == null)
         {
             HandlerFuture nextNewHandler = genNextHandler(ps);
             nextNewHandler.Begin();
         }
         yield return(prevRoutine.Current);
     }
 }
 public EventPromise(Params ps)
 {
     handler = new CustomHandler(WaitUntilTrigger, Params.Empty);
     foreach (var pair in GetDefaultParams())
     {
         if (ps.ContainsKey(pair.Key))
         {
             initialParams.Add(pair.Key, ps.GetString(pair.Key));
         }
         else
         {
             initialParams.Add(pair.Key, pair.Value);
         }
     }
 }