Exemple #1
0
        private static UniversityModule mockupEditModuleForm()
        {
            UniversityModule mod = new UniversityModule();
            mod.Name = "Algorithmen und Datenstrukturen";
            mod.ShortName = "AD";
            mod.Semester = UniversityStuff.Enums.Semester.Winter;
            mod.Department = UniversityStuff.Enums.Department.IT;
            mod.ID = 12354;

            UniversityEvent ev = new UniversityEvent();
            ev.LVNum = "67-125";
            ev.Type = UniversityStuff.Enums.EventType.Lecture;
            ev.Date = new Various.Time(8, 15, new DateTime(2012, 12, 4));
            ev.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev);

            UniversityEvent ev2 = new UniversityEvent();
            ev2.LVNum = "67-126";
            ev2.Type = UniversityStuff.Enums.EventType.Internship;
            ev2.Date = new Various.Time(10, 15, new DateTime(2012, 12, 4));
            ev2.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev2);

            UniversityEvent ev3 = new UniversityEvent();
            ev3.LVNum = "67-127";
            ev3.Type = UniversityStuff.Enums.EventType.Internship;
            ev3.Date = new Various.Time(12, 15, new DateTime(2012, 12, 4));
            ev3.Duration = new TimeSpan(1, 30, 0);
            //mod.Events.Add(ev3);

            return mod;
        }
 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.");
 }
        public static ulong AddEvent(uint moduleID, UniversityEvent toAdd)
        {
            CheckInitialization();

            if(toAdd == null)
                throw new ArgumentNullException("toAdd");

            ulong newID = toAdd.ID;
            if (!IsValidID(newID) || ContainsEvent(newID))
                newID = GenerateNewID(moduleID);

            toAdd.ID = newID;
            _events.Add(newID, toAdd);

            UniversityModule module = GetModule(moduleID);
            module.Events.Add(newID); // module.Events != null garanteed by module.

            return toAdd.ID;
        }
 public UniEventPanel(UniversityEvent ev)
 {
     this.EventToRepresent = ev;
     UpdateBackgroundColor();
 }
Exemple #5
0
        // kill me pleaase!
        private void TestEventPanel()
        {
            UniversityEvent ue = new UniversityEvent() { Type = EventType.Exercise };
            UniEventPanel panel = new UniEventPanel(ue);
            _panelMain.Controls.Add(panel);

            Timer t = new Timer();
            t.Interval = 5000;
            t.Tick += delegate(System.Object o, System.EventArgs e)
            {
                UniversityEvent newue = new UniversityEvent();
                int time = (int)DateTime.Now.Ticks;
                newue.Type = (time % 2 == 0) ? EventType.Lecture : EventType.Exercise; panel.EventToRepresent = newue;
            };
            t.Start();
        }
Exemple #6
0
 public EventTreeNode(UniversityEvent ev)
 {
     UniEvent = ev;
 }