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マネージAPI、ICalUidに基づく検索
EWSにはこれに関するドキュメントはありません。どんな種類の助けにも感謝します。
DateTime startDate = new DateTime(2016, 10, 1);
DateTime endDate = new DateTime(2017, 12, 1);
CalendarView calView = new CalendarView(startDate, endDate);