【发布时间】:2013-03-19 13:09:35
【问题描述】:
我在代码的各个部分有条件地更改XmlDocument。 XmlDocument 对象没有为此传递“已更改”标志,而是为此构建了某些标志(例如 isDirty)?
var doc = new XmlDocument();
doc.Load(file);
if (...) parent.AppendChild(element);
if (...) parent2.AppendChild(element2);
if (...) parent3.AppendChild(element3);
//METHOD DOESN'T EXIST
if (doc.isDirty())
doc.Save(file);
【问题讨论】: