public static void CancelEvent(string id) { lock (map) { ScheduledEvent ev = (ScheduledEvent)map[id]; if (ev != null) { map.Remove(id); ev.Cancel(); } } }