private void BuildTree()
        {
            _headNodes.Clear();
            _eventTree.Nodes.Clear();

            foreach (ulong evID in _module.Events)
            {
                UniversityEvent ev = UniversityManager.GetEvent(evID);
                HeadTreeNode htn = null;
                foreach (HeadTreeNode htn2 in _headNodes)
                {
                    if (htn2.EventType == ev.Type)
                    {
                        htn = htn2;
                        break;
                    }
                }
                if (htn == null)
                {
                    htn = new HeadTreeNode(ev.Type);
                    _eventTree.Add(htn);
                }

                _headNodes.Add(htn);

                EventTreeNode etn = new EventTreeNode(ev);
                htn.Nodes.Add(etn);
            }
            _eventTree.Sort();
            _eventTree.ExpandAll();
        }
 private void Add_Click(object sender, EventArgs e)
 {
     UniversityEvent ev = new UniversityEvent();
     EventTreeNode etn = new EventTreeNode(ev);
     _eventTree.Add(etn);
     _eventTree.Focus();
     _eventTree.SelectedNode = etn;
     LoggingManager.LogEvent(LogEventType.DEBUG, "New event added.");
 }
 private void ShowEventData(EventTreeNode node)
 {
     UniversityEvent ev = node.UniEvent;
     _txBoxLVNum.Text = ev.LVNum;
     _cmBoxEventType.SelectedItem = ev.Type;
     _dtPickerDate.Value = ev.Date.Date;
     int a = ev.Date.Date.Year;
     int b = ev.Date.Date.Month;
     int c = ev.Date.Date.Day;
     _dtPickerTime.Value = new DateTime(a, b, c, ev.Date.Hours, ev.Date.Minutes, 0);
     _cmBoxWeekInterval.SelectedItem = ev.Date.WeekInterval;
     _dtPickerDuration.Value = new DateTime(a, b, c, ev.Duration.Hours, ev.Duration.Minutes, ev.Duration.Seconds);
     _txBoxLocation.Text = ev.Location;
     _txBoxLecturer.Text = ev.Lecturer;
     _trackBarImportance.Value = ev.Importance;
     _ckBoxPower.Checked = ev.Power;
 }