public void AddElement(SBElement element) { bool changed = Elements.ContainsKey(element.GetId()); Elements[element.GetId()] = element; if (changed) { ElementChangeEvent(element); } else { ElementAddEvent(element); } }
public void RemoveElement(SBElement element) { if (Elements.Remove(element.GetId())) { ElementRemoveEvent(element); } }
private void OnElementChanged(SBElement element) { foreach (DataGridViewRow row in containerElements.Rows) { if ((Guid)row.Cells["Id"].Value == element.GetId()) { row.Cells["Elements"].Value = element.Name; break; } } }
private void OnElementRemoved(SBElement element) { foreach (DataGridViewRow row in containerElements.Rows) { if ((Guid)row.Cells["Id"].Value == element.GetId()) { containerElements.Rows.Remove(row); break; } } }
private void OnElementAdded(SBElement element) { containerElements.Rows.Add(element.GetId(), element.Name); }