public OnceCallbackData RequestOneTimeCallbackAtTime(DateTime wantedTime, OnceTimeCallbackDelegate callback) { var data = new OnceCallbackData() { callback = callback, time = wantedTime }; if (wantedTime <= Time) { callback(Time); } else { OnceTimeCallbacksAtTime.Add(data); OnceTimeCallbacksAtTime.Sort(); } return(data); }
public OnceCallbackData RequestOneTimeCallbackInTime(TimeSpan timeSpanFromNow, OnceTimeCallbackDelegate callback) { return(RequestOneTimeCallbackAtTime(Time + timeSpanFromNow, callback)); }