I need to do some processing on the appointments that belong to a series (regardless whether they are variances or not), and I am having a hard time finding who they are programmatically. I understand that the 'recurrence' object exposes certain properties such as DayOfMonth, Period, PeriodMultiple, etc. that determine the characteristics of the series but I need to get the specific values and their combinations to make sense of these numbers. I wonder if anybody has come across a table with those values? I have explored the source code for those values but have not gotten too far.
Any help would be appreciated.
Thanks,
AntonioL
I don't know if there is another way, but here is how i did it.
Instantiate a FrameInterval object and pass it to the BasicRecurrenceEngineFactory.
FrameInterval recurrenceInterval = new FrameInterval(this.WebScheduleInfo, root.Recurrence.StartDateUtc, root.Recurrence.EndDateUtc);
RecurrenceEngine recurrenceEngine = BasicRecurrenceEngine.RecurrenceEngineFactory(root.Recurrence, recurrenceInterval);
while (recurrenceEngine.MoveNext()){ // recurrenceEngine.CurrentActivity will advance through all of the Occurrences}
You can specify different dates in the FrameInterval constructor if you have a narrow date range that you are interested in.
Hi ChuckT,
I'm looking for a way to calculate the total hours of a recurring appointment for a specified and ran into your post above.
It looks like something I that can help me with my problem. Would you mind posting the rest of your code?
Thanks
I don't do anything like that. But you could try something like this:
decimal totalHours = 0.0;
while (recurrenceEngine.MoveNext()){ totalHours += recurrenceEngine.CurrentActivity.Duration.TotalHours;}