/// <summary> /// Removes the action with the specified ID. /// </summary> /// <param name="id">The ID of the action that should be removed.</param> public void Remove(ScheduleElementId id) { if ((id != null) && m_Actions.ContainsKey(id)) { m_Actions.Remove(id); } }
/// <summary> /// Removes the schedule with the specified ID. /// </summary> /// <param name="id">The ID of the schedule that should be removed.</param> public void Remove(ScheduleId id) { if ((id != null) && m_Schedules.ContainsKey(id)) { m_Schedules.Remove(id); } }
/// <summary> /// Removes the group that is related to the specified ID. /// </summary> /// <param name="group">The ID of the group that should be removed.</param> public void Remove(GroupCompositionId group) { if (group == null) { return; } if (!m_Groups.ContainsKey(group)) { return; } var definitionId = m_Groups[group]; var definition = m_Definitions[definitionId]; foreach (var part in definition.Parts) { var partId = new PartCompositionId(group, part.Id); Debug.Assert(m_Parts.ContainsKey(partId), "The part collection should have the given part ID."); Debug.Assert(m_PartConnections.ContainsVertex(partId), "The part connections graph should have the given part ID."); var info = m_Parts[partId]; if (info.Instance != null) { ReleaseInstance(partId); } m_PartConnections.RemoveVertex(partId); m_Parts.Remove(partId); } Debug.Assert(m_GroupConnections.ContainsVertex(group), "The connections graph should have the given group ID."); m_GroupConnections.RemoveVertex(group); m_Groups.Remove(group); if (!m_Groups.Any(p => p.Value.Equals(definitionId))) { m_Definitions.Remove(definitionId); } }