Exemple #1
0
    public MenuRoot(string fileName) : this()
    {
      XmlDocument doc = new XmlDocument();
      doc.Load(fileName);

      XmlNodeList listCollections = doc.DocumentElement.SelectNodes("collection");

      foreach (XmlNode nodeCollection in listCollections)
      {
        MenuFolder newCollection = new MenuFolder(nodeCollection.Attributes["name"].Value);
        _items.Add(newCollection);

        foreach (XmlNode nodeCommand in nodeCollection.SelectNodes("command"))
        {
          MenuCommand newCommand = new MenuCommand(nodeCommand.Attributes["name"].Value,
                                                   nodeCommand.Attributes["value"].Value);
          newCollection.Add(newCommand);
        }
      }
    }
Exemple #2
0
        public MenuRoot(string fileName) : this()
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(fileName);

            XmlNodeList listCollections = doc.DocumentElement.SelectNodes("collection");

            foreach (XmlNode nodeCollection in listCollections)
            {
                MenuFolder newCollection = new MenuFolder(nodeCollection.Attributes["name"].Value);
                _items.Add(newCollection);

                foreach (XmlNode nodeCommand in nodeCollection.SelectNodes("command"))
                {
                    MenuCommand newCommand = new MenuCommand(nodeCommand.Attributes["name"].Value,
                                                             nodeCommand.Attributes["value"].Value);
                    newCollection.Add(newCommand);
                }
            }
        }
Exemple #3
0
 public void Remove(MenuFolder item)
 {
   _items.Remove(item);
 }
Exemple #4
0
 public void Add(MenuFolder item)
 {
   _items.Add(item);
 }
Exemple #5
0
 public void Remove(MenuFolder item)
 {
     _items.Remove(item);
 }
Exemple #6
0
 public void Add(MenuFolder item)
 {
     _items.Add(item);
 }