I'm here sitting with Rory in the Xml Serialization talk being given by the legendary Doug Purdy. Doug's quite a good speaker and very funny.
我在传奇的Doug Purdy发表的Xml序列化演讲中和Rory一起坐在这里。 道格的讲话很好,很有趣。
Lengendary? Why? Well, not only is he responsible for the goodness that is the XmlSerializer, he's also responsible (or he knows the guy who is) for this undocumented switch:
<ADD value="1" name="XmlSerialization.Compilation" />
传说中的? 为什么? 好吧,他不仅要为XmlSerializer的优点负责,而且还要为这个未公开说明的开关负责(或他知道是谁): <ADD value =“ 1” name =“ XmlSerialization.Compilation” />
If you add this to a .config file (for your AppDomain) you'll get some temporary files in c:\documents and settings\local settings\ \temp. Try it. Run some serialization code and checkout the .CS file(s) that are created. Very damn useful. This works today with .NET.
如果将此文件添加到.config文件(对于您的AppDomain),则会在c:\ documents and settings \ local settings \中获得一些临时文件。 \ temp。 试试吧。 运行一些序列化代码,并检出创建的.CS文件。 该死的非常有用。 如今,它可与.NET一起使用。
But I'm here to hear about new versions of stuff. Here's some new things about XmlSerialization in the Whidbey version of .NET.
但是我在这里听到有关新版本内容的信息。 这是.NET的Whidbey版本中有关XmlSerialization的一些新东西。
Here's some new Attributes:
这是一些新属性:
Here's what's going on with XmlSerialization in Indigo (after Whidbey, in Longhorn):
这是Indigo中的XmlSerialization发生的事情(在Whidbey之后,在Longhorn中):
A Tale of Two Type Systems
两种系统的故事
Act One: Whidbey
第一幕:惠德比
Act Two: Indigo
第二幕:靛蓝
Big Conclusion - Serialization is different than Xml Programming. Developers don't think about the format on the wire. They want the CLR to fix it for them.
大结论-序列化与Xml编程不同。 开发人员不会考虑在线格式。 他们希望CLR为他们修复它。
[DataMember] lets you markup any member and include it into the Data Contract. It doesn't care about accessiblity. That means you can mark something private or internal and if it's marked with [DataMember] then it gets serialized.
通过[DataMember] ,您可以标记任何成员并将其包括在Data Contract中。 它不在乎可访问性。 这意味着您可以将某些内容标记为私有或内部,如果标记为[DataMember],则会对其进行序列化。
WHY IS THIS IMPORTANT: You can serialize one CLR object from one Assembly and deserialize it into another totally different implemenation (a totally different CLR type). As long as we both agree on the contract, we can use the same underlying data representation. Yum.
为什么这样做很重要:您可以从一个Assembly中序列化一个CLR对象,并将其反序列化为另一种完全不同的实现(一种完全不同的CLR类型)。 只要我们双方都同意合同,就可以使用相同的基础数据表示形式。 好吃
Doug said he woke up this morning hoping the sky would be Indigo. It wasn't. But one day...
道格说他今天早上醒来,希望天空是靛蓝。 不是。 但是有一天
P.S. I forgot to mention that Christian Weyer can lift Rory with ease. If he were Austrian, he could be a governor.
附言:我忘了提克里斯蒂安·韦耶(Christian Weyer)可以轻松举起罗瑞(Rory) 。 如果他是奥地利人,他可以担任州长。