static private MenuBase GenerateMenuLeaf(XmlNode menuLeaf, MenuBase parentNode) { if (menuLeaf == null || !menuLeaf.HasChildNodes) { return(null); } string Name = menuLeaf.SelectSingleNode("Name").InnerText; MenuLeaf thisLeaf = new MenuLeaf(parentNode, null, Name); List <MenuBase> ChildNodes = new List <MenuBase>(); foreach (XmlNode node in menuLeaf.ChildNodes) { if (node.Name == "MenuLeaf" && node.HasChildNodes) { ChildNodes.Add(GenerateMenuLeaf(node, thisLeaf)); } else if (node.Name == "MenuNode") { ChildNodes.Add(GenerateMenuNode(node, thisLeaf)); } } thisLeaf.SetChildLeafs(ChildNodes); return(thisLeaf); }
public MenuLeaf(MenuBase PLeaf, List <MenuBase> CLeafs, string MyName) : base() { ParentLeaf = PLeaf; Name = MyName; ChildLeafs = CLeafs; }
public abstract bool SetparentLeaf(MenuBase PLeaf);
public MenuNode(MenuBase PLeaf, string MyName) : base(PLeaf, null, MyName) { }