Я создаю программу менеджера дизайна. Программа запускается из базы данных XML . Я загружаю данные в древовидную структуру, где затем могу отображать подробные данные в виде списка.
Что у меня есть:
XDocument xdoc = XDocument.Load("XML Template.xml");
var CustomerList = from q in xdoc.Descendants("Customer")
select new
{
Customer = q.Element("Name").Value
};
//add all the customers as top nodes to the treeview
foreach (var assemblyList in CustomerList)
{
// get all the assembly numbers under that customer name.
// add node to the tree view under the customer node.
foreach (var partlist in assemblyList)
{
// get all of the parts under that assembly number
// Add parts to the tree view under the aseembly node.
foreach (var file in partlist)
{
//add the data to another view
}
}
}
Кажется, я не могу найти хороший способ кодирования такой структуры с помощью LINQ или System.xml.