2010-12-16 41 views
2

我正在編寫一個代碼來將我的Outlook日曆與Google日曆同步。我能夠添加條目,但問題是當我想更新谷歌日曆中的項目,我不知道哪一個更新。使用Google日曆API添加和檢索擴展屬性

對於解決,我將擴展屬性

 ExtendedProperty property = new ExtendedProperty(); 
     property.Name = reminderAppt.GlobalAppointmentID; 
     property.Value = "App Id"; 
     entry.ExtensionElements.Add(property); 

的問題是我不知道如何檢索同一條目時ItemChanged被調用。

回答

3

這就是我用來檢索擴展屬性元素。

foreach (Google.GData.Client.IExtensionElementFactory property in googleEvent.ExtensionElements) 
     { 
      ExtendedProperty customProperty = property as ExtendedProperty; 
      if (customProperty != null) 
       genericEvent.EventID = customProperty.Value;     
     } 
0

老問題,但對於一些也許有幫助的:

的EventEntry.Insert方法有一個返回值,它返回一個包含了谷歌calendarItem的獨特EVENTID的對象。

您可以使用該ID來保持日曆條目與Outlook同步。

相關問題