I am looking for the correct way to get the recurrence pattern associated with an appointment using EWS Managed API 1.2. My code looks something like this:
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Calendar, view);
foreach (Appointment appointment in findResults)
{
appointment.Load();
if (appointment.IsRecurring)
{
// What is the recurrence pattern???
}
}
I can do a appointment.Recurrence.ToString() and I get back like Microsoft.Exchange.WebServices.Data.Recurrence+WeeklyPattern. Obviously I could parse that and determine the type, but that doesn’t seem very clean. Is there a better way?
There is another post similar to this here – EWS: Accessing an appointments recurrence pattern but the solution does not seem complete.
here’s a full list of the patterns. Cause of there is no Property you could as what pattern is in use, you will have to cast the recurrence to the pattern. in my project I solved this problem this way:
hope that helps you…