public EventClass AddEvent(DateTime dateTime, string tag, string description) { EventClass evt = new EventClass(dateTime); evt.EventID = _newEventId++; evt.Tag = tag; evt.Description = description; return SetEvent(evt); }
public EventClass SetEvent(EventClass evt) { try { _sortedEvents[evt] = evt.EventID; _events[evt.EventID] = evt; // todo: this should be considered to be done on a different thread SetNextTimer(); return evt; } catch { return null; } }
public void RemoveEvent(EventClass evt) { try { if (_sortedEvents.ContainsKey(evt)) { _sortedEvents.Remove(evt); _events.Remove(evt.EventID); SetNextTimer(); } } catch { } }