示例#1
0
 public int AddTask(ulong sessionId, Action <T> fn, T context, TimeSpan atTime, bool repeated = false)
 {
     if (scheduledTasks.TryGetValue(sessionId, out TaskContainer <T> container))
     {
         return(container.CreateNewReminder(fn, context, atTime, repeated));
     }
     else
     {
         TaskContainer <T> rc = new TaskContainer <T>();
         rc.Id = sessionId;
         scheduledTasks.Add(sessionId, rc);
         return(rc.CreateNewReminder(fn, context, atTime, repeated));
     }
 }