【发布时间】:2014-07-28 13:02:08
【问题描述】:
好的,我有一个 XDocument
BaseDocument = XDocument.Load(@".\Example\Template.xml");
以及由方法生成的 XElements(在 XDocument 内部)的一些 DataStructure。这只是一个例子:
Dictionary<string, List<XElement>> ElementMap = GetElementMapping(BaseDocument);
我想对两者进行深拷贝,
有没有比,更有效的方法,
XDocument copy = new XDocument(BaseDocument);
Dictionary<string, List<XElement>> copyElementMap = GetElementMapping(copy);
复制数据结构以便内部的 XElements 引用新副本?
我做了一些图片来展示我想要的东西:
当前解决方案:
我想要解决方案:
【问题讨论】:
标签: c# linq-to-xml deep-copy