相关疑难解决方法(0)

Exchange Web服务:为什么ItemId不是常量?[继续]

正如其他一些人之前讨论过这个问题(例如,Exchange Web服务:为什么ItemId不是常数?),我想谈谈解决方案,我已经做了人们通过将Guid标记为扩展属性而建议的内容,对我而言解决方案有点好(虽然我不知道如何使其与出现的一起工作)但只要应用程序正常工作,一旦应用程序重新启动项目的扩展属性消失,所以我现在的问题是" 如何在EWS项目上标记扩展属性并使其不断存在?"这是更新日历项目(约会)的代码

public void SetGuidForAppointement(Appointment appointment)
{         
appointment.SetExtendedProperty((ExtendedPropertyDefinition)_appointementIdPropertyDefinition, Guid.NewGuid().ToString());
appointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);
}
Run Code Online (Sandbox Code Playgroud)

这些是上面需要的属性定义.

_appointementIdPropertyDefinition = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, "AppointmentID", MapiPropertyType.String);
            _propertyDefinitionBases = new PropertyDefinitionBase[] { _appointementIdPropertyDefinition, ItemSchema.ParentFolderId, AppointmentSchema.Start, AppointmentSchema.End, 
AppointmentSchema.LegacyFreeBusyStatus, AppointmentSchema.Organizer };
            PropertySet = new PropertySet(BasePropertySet.FirstClassProperties, _propertyDefinitionBases);
Run Code Online (Sandbox Code Playgroud)

因此,如果有人在此之前完成此操作,他/她可以向我提供一个示例,即使应用程序退出,也会将扩展属性标记在项目上.谢谢

c# exchangewebservices

9
推荐指数
1
解决办法
3500
查看次数

标签 统计

c# ×1

exchangewebservices ×1