/// <summary> /// Loads the config file. /// </summary> private void LoadConfigFile() { var file = string.Format("{0}\\{1}", Application.StartupPath, this._configFile); var xml = new XmlDocument(); xml.Load(file); var nodeList = xml.ChildNodes; if (nodeList.Count < 2) throw new Exception(string.Format("MenuFile is invalid format. [ File Name: {0}]", this._configFile)); this._rootItem = new TopMenuItem(nodeList[1]); }
/// <summary> /// Bindings the menu item. /// </summary> /// <param name="cntrl">The CNTRL.</param> /// <param name="item">The item.</param> public void BindingMenuItem(Control cntrl, TopMenuItem item) { }
private void GetNote(TreeNode node, TopMenuItem item) { if (item == null) return; if (item.Childs.Count == 0) return; foreach (var child in item.Childs) { var childNode = new TreeNode(child.Name); childNode.Name = child.Key; GetNote(childNode, child); node.Nodes.Add(childNode); } }