Hi,
I need to retrieve the recurrence pattern and set it to our custom object. I tried various methods. In all these cases, I am not able to retrieve DaysOfWeekMask which holds values like "Sunday" or "Monday|Tuesday|Wednesday" and cast it to our custom object DaysOfWeek which is also an enum.
1st Method
a) RecurrenceDays days = new RecurrenceDays();
days = days.AddDay(CurrentCreatedAppointment.RecurrenceRule.Pattern.DaysOfWeekMask);
var s = days.GetDaysOfWeek().Select(x => (DaysOfWeek)Enum.Parse(typeof(DaysOfWeek), x.ToString())).AsEnumerable();
viewModel.BackupArchiveSettings.ByDay = new ObservableCollection<DaysOfWeek>( s);
var k = s.GetEnumerator();
var k1 = k.Current;
2nd Method
RecurrenceDays days = new RecurrenceDays();
days = days.AddDay(CurrentCreatedAppointment.RecurrenceRule.Pattern.DaysOfWeekMask);
var s = days.GetDaysOfWeek().Select(x => (DaysOfWeek)Enum.Parse(typeof(DaysOfWeek), x.ToString())).AsEnumerable();
newcol = new ObservableCollection<DaysOfWeek>();
foreach (var item in s.ToList())
{
viewModel.BackupArchiveSettings.ByDay.Add(item);
}
Please help
Thanks,
Divya