public bool AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { return(AddReminder(new Reminder(callback, dateTime, data) { Clock = this })); }
public Reminder AddReminderWithHandler(ReminderCallback callback, DateTime dateTime, object data = null) { var reminder = new Reminder(callback, dateTime, data) { Clock = this }; return(AddReminder(reminder) ? reminder : null); }
// public bool AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) // { // return AddReminder(new Reminder(callback, dateTime, data) {Clock = this}); // } public Reminder AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { return(AddReminder(new Reminder(callback, dateTime, data) { Clock = this })); // var reminder = new Reminder(callback, dateTime, data) {Clock = this}; // return AddReminder(reminder) ? reminder : null; }
//TODO: the logic is twisted! make var events private! public void Remove(ReminderCallback callback, DateTime dateTime) { lock (this) { for (int i = 0; i < Count; i++) { var reminder = (Reminder)this.events[i]; if (reminder.Callback == callback && reminder.DateTime == dateTime) { this.events.RemoveAt(i); if (i == 0 && this.events.Count != 0) { this.dateTime = this.events[0].DateTime; } break; } } } }
//TODO: the logic is twisted! make var events private! public void Remove(ReminderCallback callback, DateTime dateTime) { lock (this) { for (int i = 0; i < Count; i++) { var reminder = (Reminder)this.events[i]; if (reminder.Callback == callback && reminder.DateTime == dateTime) { this.events.RemoveAt(i); if (i == 0 && this.events.Count != 0) { this.dateTime = this.events[0].DateTime; } break; } } } }
public Reminder(ReminderCallback callback, DateTime dateTime, object data) : base(dateTime) { this.Callback = callback; this.Data = data; }
public void AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { this.AddReminder(new Reminder(callback, dateTime, data)); }
public Reminder(ReminderCallback callback, DateTime dateTime, object data) : base(dateTime) { Callback = callback; Data = data; }
public void RemoveReminder(ReminderCallback callback, DateTime dateTime) { ((ReminderEventQueue)ReminderQueue).Remove(callback, dateTime); }
public void RemoveReminder(ReminderCallback callback, DateTime dateTime) { ((ReminderEventQueue)ReminderQueue).Remove(callback, dateTime); }
// public bool AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) // { // return AddReminder(new Reminder(callback, dateTime, data) {Clock = this}); // } public Reminder AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { return AddReminder(new Reminder(callback, dateTime, data) {Clock = this}); // var reminder = new Reminder(callback, dateTime, data) {Clock = this}; // return AddReminder(reminder) ? reminder : null; }
public void AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { this.AddReminder(new Reminder(callback, dateTime, data)); }
public Reminder(ReminderCallback callback, DateTime dateTime, object data = null) : base(dateTime) { this.callback = callback; this.data = data; }
public Reminder AddReminderWithHandler(ReminderCallback callback, DateTime dateTime, object data = null) { var reminder = new Reminder(callback, dateTime, data) {Clock = this}; return AddReminder(reminder) ? reminder : null; }
public bool AddReminder(ReminderCallback callback, DateTime dateTime, object data = null) { return AddReminder(new Reminder(callback, dateTime, data) {Clock = this}); }
public void RemoveReminder(ReminderCallback callback, DateTime dateTime) { throw new System.NotImplementedException(); }