如何使用c#从EWS获取定期会议的发生次数?
下面是用于修改和删除定期会议事件的链接 我的问题是,我们如何从ews获取事件数,或者有没有办法找到它如何使用c#从EWS获取定期会议的发生次数?,c#,exchange-server,exchangewebservices,C#,Exchange Server,Exchangewebservices,下面是用于修改和删除定期会议事件的链接 我的问题是,我们如何从ews获取事件数,或者有没有办法找到它 Appointment occurrence = Appointment.BindToOccurrence(service, new ItemId(sRecurringMasterId), 3); 在上面的代码中,他们硬编码的事件编号为3,但我如何动态获取此信息?没有直接的方法,我所做的是: 获得作为复发大师的预约 如果没有重复,请定义重复的开始和结束时间 结束时间,就像永远过去一样,然后我
Appointment occurrence = Appointment.BindToOccurrence(service, new ItemId(sRecurringMasterId), 3);
在上面的代码中,他们硬编码的事件编号为3,但我如何动态获取此信息?没有直接的方法,我所做的是:
var occurrencesCounter = 0;
if (appointment.AppointmentType == AppointmentType.RecurringMaster)
{
appointments = ppointment.Service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(appointment.Start, (appointment.Recurrence.EndDate == null ? DateTime.Today.AddDays(7) : (DateTime)appointment.Recurrence.EndDate)));
foreach (var apt in appointments)
{
if (apt.AppointmentType == AppointmentType.Occurrence)
{
occurrencesCounter++;
}
}
}