0
我写了使用的XMLDocumentXMLDOCUMENT等值的XDocument
string Query = @"/ShortcutList/" + Modality;
XmlNodeList nodes = shortcutsXMLDocument.SelectNodes(Query);
if (nodes == null)
{
// if the modality not exists, I will load the Default one
Query = @"/ShortcutList/Default";
nodes = shortcutsXMLDocument.SelectNodes(Query);
}
for (int i = 0; i < nodes[0].ChildNodes.Count; i++)
{
// do something here
}
其中shortcutsXMLDocument
是为XMLDocument
如何使用的XDocument它转换,我没能找到相当于的SelectNodes中的XDocument
任何想法请