Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public MenuLeaf(MenuBase PLeaf, List <MenuBase> CLeafs, string MyName) : base()
 {
     ParentLeaf = PLeaf;
     Name       = MyName;
     ChildLeafs = CLeafs;
 }
Ejemplo n.º 3
0
 public abstract bool SetparentLeaf(MenuBase PLeaf);
Ejemplo n.º 4
0
 public MenuNode(MenuBase PLeaf, string MyName) : base(PLeaf, null, MyName)
 {
 }