public void stop(int id) { IDictionaryEnumerator enumerator = (IDictionaryEnumerator)this.schGroup.ScheduledEvents.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Key.Equals("device" + id) || enumerator.Key.Equals("scene" + id) || enumerator.Key.Equals("e_device" + id) || enumerator.Key.Equals("e_scene" + id)) { ScheduledEvent eve = (ScheduledEvent)enumerator.Value; eve.Disable(); this.schGroup.DeleteEvent(eve); } } }