Exemplo n.º 1
0
        protected override void InitSchedule(NSchedule schedule)
        {
            DateTime today     = DateTime.Today;
            DateTime startDate = new DateTime(today.Year, 1, 1);

            // Create an appointment which occurs per 3 hours
            NAppointment          appointment = new NAppointment("Meeting", today, today.AddHours(2));
            NRecurrenceHourlyRule rule        = new NRecurrenceHourlyRule();

            rule.StartDate             = startDate;
            rule.Interval              = 3;
            appointment.RecurrenceRule = rule;
            schedule.Appointments.Add(appointment);

            // Create an appointment which occurs every hour and categorize it
            appointment                = new NAppointment("Talking", today, today.AddHours(0.5));
            rule                       = new NRecurrenceHourlyRule();
            rule.StartDate             = startDate;
            rule.Interval              = 1;
            appointment.RecurrenceRule = rule;
            appointment.Category       = "Red";
            schedule.Appointments.Add(appointment);

            // Swicth schedule to week view mode
            schedule.ViewMode = ENScheduleViewMode.Week;
        }
Exemplo n.º 2
0
        private NRecurrenceHourlyRule CreateHourlyRule()
        {
            // Create a rule, which occurs every 3 hours
            NRecurrenceHourlyRule rule = new NRecurrenceHourlyRule();

            rule.StartDate = RuleStart;
            rule.Interval  = 3;
            return(rule);
        }