protected void OnLoadbuttonClick(object target, EventArgs e) { if (OpenFileDialog.ShowDialog() == DialogResult.OK) { //Groups = SaveLoad.LoadData(OpenFileDialog.FileName); try { Groups = SaveLoad.LoadData(OpenFileDialog.FileName); } catch (Exception) { MessageBox.Show($"File \"{FormatFileName(OpenFileDialog.FileName)}\" contains invalid data.", "Oh no!"); return; } HidePostList(); HideMeetingList(); GroupPanel.HidePanel(); GroupList.RemoveAllItems(); GroupList.AddItemsBy("Name", Groups); } }
/// ******************************* EVENTS ********************************** protected void OnGroupListSelect(CarbolistItem target) { if (target.Selected) // user selected a group { if (target.Data == SelectedGroup) // user deselected a group, then selected the same group again { MeetingList.DeselectItem(); } else // user selected another group { // refresh the meeting and post orders in the group that was selected before UpdateMeetingOrders(); UpdatePostOrders(); // update selected group reference SelectedGroup = target.Data as Group; // hide post list HidePostList(); // refresh meeting list items MeetingList.RemoveAllItems(); MeetingList.AddItemsBy("Name", SelectedGroup.Meetings); GroupPanel.HidePanel(); } GroupPanel.ShowPanel(target); SelectedMeeting = null; SelectedPost = null; ShowMeetingList(); HideMeetingPanel(); //tra.ce(SelectedGroup.Name, SelectedGroup.Description); } else // user deselcted a group { UpdateMeetingOrders(); UpdatePostOrders(); HideMeetingList(); HidePostList(); GroupPanel.HidePanel(); } }