I have one XML file as:
I want to iterate through all <Menu> items to show them on toolbar. So in c# I have:
This gives me only first menu. How should I iterate thro' all <Menu> in <MenuItems> so that I can have all menus on toolbar.
Thanx...
Prashant
Sharing the best from my side...
--Prashant--
Code:
<MenuItems>
<Menu>
<Caption>&Set Field Identifier Prefix</Caption>
<Action>SetFieldIdentifierPrefix</Action>
</Menu>
<Menu>
<Caption>&Remove Field Identifier Prefix</Caption>
<Action>RemoveFieldIdentifierPrefix</Action>
</Menu>
</MenuItems>
I want to iterate through all <Menu> items to show them on toolbar. So in c# I have:
Code:
private const string CAP = "/Caption";
private const string ACT = "/Action";
private const string XPATH_STRING = "/MenuItems/Menu";
XPathDocument XPathDoc = new XPathDocument(FileName);
XPathNavigator Navigator = XPathDoc.CreateNavigator();
string Caption = Navigator.SelectSingleNode(XPATH_STRING + CAP).Value;
string Action = Navigator.SelectSingleNode(XPATH_STRING + ACT).Value;
AddButton(Caption, Action);
This gives me only first menu. How should I iterate thro' all <Menu> in <MenuItems> so that I can have all menus on toolbar.
Thanx...
Prashant
Sharing the best from my side...
--Prashant--