示例#1
0
        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);
        }
示例#2
0
        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; }
        }
示例#3
0
 public void RemoveEvent(EventClass evt)
 {
     try
     {
         if (_sortedEvents.ContainsKey(evt))
         {
             _sortedEvents.Remove(evt);
             _events.Remove(evt.EventID);
             SetNextTimer();
         }
     }
     catch
     { }
 }