John,
In order to find your recurring master appointment you will need to use the FindAppointments()
method. Specifying the start and end dates in this method will allow you see any recurring appointment that spans the date range. You can then filter your appointments by checking the Sensitivity and Categories properties of these appointments
Once you find an appointment that meets your criteria, check the AppointmentType
property to determine what to do next. If it's an Occurrence or Exception then you can use the Appointment.BindToRecurringMaster()
method to get to your recurring master. Here's an example:
switch (calendarItem.AppointmentType)
{
case AppointmentType.RecurringMaster:
// Nothing to do here since you are already on the recurring master
break;
case AppointmentType.Single:
// This is not a recurring series
break;
case AppointmentType.Occurrence:
// We need to get to the recurring master
Appointment recurringMaster = Appointment.BindToRecurringMaster(service, calendarItem.Id);
break;
case AppointmentType.Exception:
// We need to get to the recurring master
Appointment recurringMaster = Appointment.BindToRecurringMaster(service, calendarItem.Id);
break;
}
Now that you have a reference to your recurring master you can loop through the occurrences as you did before.
I hope this helps.