jeudi 30 janvier 2020

C# Display an XML file in a ListBox with possibility to edit the XML

i am actually trying to do a sort of random menu generator for lunch or dinner, i have an XML file in my app resources with multiples nodes, i want to put every STARTER NAME as items in a combobox, then you can choose an item and the STARTER NAME, DESC and RECIPE will be shown in the ListBox. Then on another tab i can create a random menu with starter, main course and dessert. The problem is that's the first time that i need to deal with XML and i dont know how to do what i want to do, i tried a lot of things that i've seen on forums but nothing was working for me.

My XML File looks like that :

<xmlentrees>
  <entrees>
<entree>
    <Nomentree>STARTER NAME</Nomentree>
    <descentree>STARTER DESC</descentree>   
    <recetteentree>RECIPE (YES/NO)</recetteentree>
    <recette>RECIPE THERE</recette>
</entree>
<entree>
    <Nomentree>STARTER NAME</Nomentree>
    <descentree>STARTER DESC</descentree>   
    <recetteentree>RECIPE (YES/NO)</recetteentree>
    <recette>RECIPE THERE</recette>
</entree>
<entree>
    <Nomentree>STARTER NAME</Nomentree>
    <descentree>STARTER DESC</descentree>   
    <recetteentree>RECIPE (YES/NO)</recetteentree>
    <recette>RECIPE THERE</recette>
</entree>
  </entrees>

<nombreentrees>TOTAL OF STARTER LISTED</nombreentrees>

</xmlentrees>

(I am really sorry if my english is not correct, i'm french and still learning english)




Aucun commentaire:

Enregistrer un commentaire