简体   繁体   English

将ChangeCollection类型更改为约会类型EWS

[英]ChangeCollection type into Appointment type EWS

I am doing syncing using Exchange server web services(EWS). 我正在使用Exchange服务器Web服务(EWS)进行同步。 TO do sync need to identify change items in Calendar after last sync. 要进行同步,需要在上次同步后在日历中标识更改项。 To do that this link help you a lot. 为此, 此链接对您有很大帮助。 While using that i need to take appointment start,end etc... 使用时我需要预约开始,结束等...

ChangeCollection<ItemChange> allExchEvents = service.SyncFolderItems(new FolderId(WellKnownFolderName.Calendar), PropertySet.FirstClassProperties, null, 512, SyncFolderItemsScope.NormalItems, sSyncState);   

How could i convert this change events to Appointment type ? 我如何将更改事件转换为约会类型?

After looking at MSDN document and some blogs I found the answer. 在查看了MSDN文档和一些博客之后,我找到了答案。

 ChangeCollection<ItemChange> icc = service.SyncFolderItems(new FolderId(WellKnownFolderName.Calendar), PropertySet.FirstClassProperties, null, 512, SyncFolderItemsScope.NormalItems, sSyncState);
 sSyncState = icc.SyncState;

 if (icc.Count == 0)
 {
   Console.WriteLine("There are no item changes to synchronize.");
 }
 else
 {        
   foreach (ItemChange ic in icc)
   {
     **Appointment ap = (Appointment)ic.Item;**
   }
 }

Use "ap" object to retrieve appointment inner properties. 使用“ ap”对象检索约会内部属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM