VSTO/Outlook 约会项目对象的序列化?
我目前正在使用 c# 和 vsto 为 Outlook 创建一个插件,需要从约会项目中提取所有数据,我已经尝试过 XML 序列化程序,看来该对象受到某种保护,是否可以绕过这个或是否有另一种序列化技术可以做到这一点? 如果没有,是否有一种更简单的方法可以通过访问对象的每个单独属性来从对象中提取所有数据(我真的不喜欢输入每个属性!)。
I'm currently using c# and vsto to create an addon for outlook and need to extract all of the data from an appointmentitem, I have tried the XML serialiser and it appears that the object is somehow protected, is it possible to get around this or is there another serialisation technique that would be capable of this?
If not is there an easier way of extracting all the data from the object over accessing each individual property of the object (I don't really fancy typing each property out!).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并非所有对象都可以序列化。我猜 Outlook AppointmentItem 对象就是其中之一。这通常是由于它对其他对象的引用。
您可能想研究浅/深复制: http:// /msdn.microsoft.com/en-us/library/system.object.memberwiseclone.aspx
在这种情况下,制作浅表副本并序列化该副本可能就足够了,具体取决于您打算用它做什么。
Not all objects can be serialized. I would guess the Outlook AppointmentItem object is one of them. This is often due to references it has to other objects.
You may want to look into shallow/deep-copy: http://msdn.microsoft.com/en-us/library/system.object.memberwiseclone.aspx
In yout case making a shallow copy and serializing the copy may be enough depending on what you are planning to do with it.