1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
private void LoadSpecificRunFromXML()
{
//Chargement du fichier xml_specific_run_file dans l'objet XmlDocument XmlDoc
try
{
this.str = File.OpenText(xml_specific_run_file);
}
catch (Exception err) { new Error("Error while loading specific run from xml file: " + xml_specific_run_file, err.Message); }
this.xmlDoc.Load(str);
str.Close();
for (int i = 0; i < TV.Nodes.Count; i++)
{
XmlNodeList tmp_ndl = this.xmlDoc.SelectNodes("/Week/" + TV.Nodes[i].Text + "/RUN");
for (int j = 0; j < tmp_ndl.Count; j++)
{
try
{
TreeNode child_node = new TreeNode();
child_node.Text = tmp_ndl[j].ChildNodes[0].InnerText;//ChildNode[0] -> <TEXT></TEXT>
child_node.Name = tmp_ndl[j].ChildNodes[1].InnerText;//ChildNode[1] -> <NAME></NAME>
child_node.ImageIndex = 1;
child_node.SelectedImageIndex = 1;
TV.Nodes.Find(TV.Nodes[i].Text, false)[0].Nodes.Add(child_node);
}
catch (Exception err) { new Error("Error while loading specific run from xml file: " + xml_specific_run_file, err.Message); }
}
}
} |
Partager