예제 #1
0
        /// <summary>
        /// recursive appointments
        /// </summary>
        ////creating RecurrsiveAppointments
        private void CreateRecurrsiveAppointments()
        {
            this.RecursiveAppointmentCollection = new ObservableCollection <Event>();

            DateTime currentDate = DateTime.Now.AddMonths(-1);

            Event dailyEvent = new Event
            {
                EventName            = "Daily recurring meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 9, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 10, 0, 0),
                Color                = new SolidColorBrush((Color.FromArgb(255, 191, 235, 97))),
                ForegroundColor      = new SolidColorBrush(Color.FromArgb(255, 51, 51, 51)),
                RecurrenceRule       = "FREQ=DAILY;INTERVAL=1;COUNT=100",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(dailyEvent);

            Event weeklyEvent = new Event
            {
                EventName            = "Weekly recurring meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 11, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 12, 0, 0),
                Color                = new SolidColorBrush((Color.FromArgb(255, 45, 216, 175))),
                ForegroundColor      = new SolidColorBrush(Color.FromArgb(255, 51, 51, 51)),
                RecurrenceRule       = "FREQ=WEEKLY;BYDAY=MO,WE,FR;INTERVAL=1;COUNT=20",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(weeklyEvent);

            Event monthlyEvent = new Event
            {
                EventName            = "Monthly recurring Meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 12, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 13, 0, 0),
                Color                = new SolidColorBrush(Microsoft.UI.Colors.Red),
                RecurrenceRule       = "FREQ=MONTHLY;BYDAY=TU;BYSETPOS=1;INTERVAL=1;COUNT=50",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(monthlyEvent);

            Event yearlyEvent = new Event
            {
                EventName            = "Yearly recurring Meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 2, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 3, 0, 0),
                Color                = new SolidColorBrush(Microsoft.UI.Colors.Yellow),
                RecurrenceRule       = "FREQ=YEARLY;BYMONTHDAY=3;BYMONTH=5;INTERVAL=1;COUNT=50",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(yearlyEvent);
        }
예제 #2
0
        /// <summary>
        /// recursive appointments
        /// </summary>
        ////creating RecurrsiveAppointments
        private void CreateRecurrsiveAppointments()
        {
            this.RecursiveAppointmentCollection = new ObservableCollection <SchedulerModel>();

            DateTime currentDate = DateTime.Now.AddMonths(-1);

            SchedulerModel dailyEvent = new SchedulerModel
            {
                EventName            = "Daily recurring meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 9, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 10, 0, 0),
                Color                = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFA2C139")),
                RecurrenceRule       = "FREQ=DAILY;INTERVAL=1;COUNT=100",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(dailyEvent);

            SchedulerModel weeklyEvent = new SchedulerModel
            {
                EventName            = "Weekly recurring meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 11, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 12, 0, 0),
                Color                = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFD80073")),
                RecurrenceRule       = "FREQ=WEEKLY;BYDAY=MO,WE,FR;INTERVAL=1;COUNT=20",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(weeklyEvent);

            SchedulerModel monthlyEvent = new SchedulerModel
            {
                EventName            = "Monthly recurring Meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 12, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 13, 0, 0),
                Color                = Brushes.Red,
                RecurrenceRule       = "FREQ=MONTHLY;BYDAY=TU;BYSETPOS=1;INTERVAL=1;COUNT=50",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(monthlyEvent);

            SchedulerModel yearlyEvent = new SchedulerModel
            {
                EventName            = "Yearly recurring Meeting",
                From                 = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 2, 0, 0),
                To                   = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, 3, 0, 0),
                Color                = Brushes.Yellow,
                RecurrenceRule       = "FREQ=YEARLY;BYMONTHDAY=3;BYMONTH=5;INTERVAL=1;COUNT=50",
                RecurrenceExceptions = new ObservableCollection <DateTime>()
            };

            RecursiveAppointmentCollection.Add(yearlyEvent);
        }