Appointment newAppointment = new Appointment(service);
newAppointment.Subject = "Test Subject";
newAppointment.Start = new DateTime(2017, 01, 05, 17, 00, 0);
newAppointment.StartTimeZone = TimeZoneInfo.Local;
newAppointment.EndTimeZone = TimeZoneInfo.Local;
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.ICalUid = "asdasda=";
newAppointment.Save();
newAppointment.Body = new MessageBody(BodyType.Text, "test");
newAppointment.RequiredAttendees.Add("[email protected]");
newAppointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToAll);
ExtendedPropertyDefinition CleanGlobalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, "ICalUid", MapiPropertyType.String);
PropertySet psPropSet = new PropertySet(BasePropertySet.FirstClassProperties);
psPropSet.Add(CleanGlobalObjectId);
newAppointment.Load(psPropSet);
Folder AtndCalendar = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, "[email protected]"));
SearchFilter sfSearchFilter = new SearchFilter.IsEqualTo(CleanGlobalObjectId, "asdasda=");
ItemView ivItemView = new ItemView(1);
FindItemsResults <Item> fiResults = AtndCalendar.FindItems(sfSearchFilter, ivItemView);
if (fiResults.Items.Count > 0) {
//do whatever
}
Это не работает для меня. И я не хочу использовать приведенный ниже код, где мы перебираем календарный вид. Искали во многих местах и пробовали много кодовых частей.EWS Managed API, поиск на основе ICalUid
EWS не имеет документации по этому вопросу. Любая помощь будет оценена по достоинству.
DateTime startDate = new DateTime(2016, 10, 1);
DateTime endDate = new DateTime(2017, 12, 1);
CalendarView calView = new CalendarView(startDate, endDate);