C# 使用Google日历API添加和检索扩展属性

C# 使用Google日历API添加和检索扩展属性,c#,google-calendar-api,C#,Google Calendar Api,我正在写一个代码来同步我的outlook日历和google日历。我可以添加条目,但问题是当我想更新谷歌日历中的一个项目时,我不知道要更新哪个项目 为了解决这个问题,我添加了扩展属性 ExtendedProperty property = new ExtendedProperty(); property.Name = reminderAppt.GlobalAppointmentID; property.Value = "App Id";

我正在写一个代码来同步我的outlook日历和google日历。我可以添加条目,但问题是当我想更新谷歌日历中的一个项目时,我不知道要更新哪个项目

为了解决这个问题,我添加了扩展属性

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

问题是当调用
ItemChanged
时,我不知道如何检索相同的条目。

这就是我在检索扩展属性元素时使用的方法

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

老问题,但可能对某些人有用:

Insert方法得到一个returnvalue,它返回一个包含google calendarItem的唯一EventId的对象

您可以使用该id使日历条目与outlook保持同步