private void RemoveSchedulingForInitiative(InternalEventScheduling es) { if (es?.Initiative is InternalInitiative init) { scheduledEventsForInitiatives.Remove(init, es); if (init.AutoRemove && !scheduledEventsForInitiatives.AnyValues(init)) { // Get rid of an AutoRemove Initiative when there are no more scheduled events referencing it scheduledEventsForInitiatives.Clear(init); oc.Remove(init); } } }