2017-01-03 1 views
0
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); 

답변

0

메모리가 작동하는 경우 ICalUid를 기반으로 검색 할 수 없습니다. 내가 생각하는 이유 중 하나는 그 이름에도 불구하고 반드시 고유하지 않기 때문이라고 생각합니다. 예 : 모임을 만들고 두 개의 방을 초대 할 경우 ICalUid는 두 방의 일정뿐 아니라 내 방의 일정에도 동일합니다.

저장할 약속에서 ItemId를 선택하지 않는 이유는 무엇입니까? 샘플 코드에서 보여주는 것 이상의 다른 이유가 있다고 생각하십니까?

-1

확장 속성 사용.

ExtendedPropertyDefinition def = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, APPOINTMENTIDEXTENDPROPNAME, MapiPropertyType.String);