public void refreshGroups(Division division) { SuspendLayout(); Controls.Clear(); List <Group> groups = DataManager.GroupManager.getSortedGroupList(DataManager.CurrentDivision); foreach (Group g in groups) { GroupPanel groupPanel = new GroupPanel(g); Controls.Add(groupPanel); groupPanel.Dock = DockStyle.Top; } ResumeLayout(true); }
private void GroupPanel_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(RegistrantPanel))) { RegistrantPanel item = (RegistrantPanel)e.Data.GetData(typeof(RegistrantPanel)); Group.addRegistrant(item.Registrant); DataManager.GroupManager.updateUI(Group.Division); } if (e.Data.GetDataPresent(typeof(GroupPanel))) { GroupPanel item = (GroupPanel)e.Data.GetData(typeof(GroupPanel)); item.Group.Order = Group.Order; DataManager.GroupManager.reorder(item.Group); DataManager.GroupManager.updateUI(Group.Division); } }