Example #1
0
        private GUIMenuItem CreateMenuItem(XmlElement element)
        {
            GUIMenuItem item = new GUIMenuItem();

            item.Name     = element.InnerText;
            item.Shortcut = element.GetAttribute("Shortcut");
            if (Boolean.TryParse(element.GetAttribute("IsEnabled"), out bool isEnabled))
            {
                item.IsEnabled = isEnabled;
            }
            if (Boolean.TryParse(element.GetAttribute("IsPressed"), out bool isPressed))
            {
                item.IsPressed = isPressed;
            }
            if (Boolean.TryParse(element.GetAttribute("IsSelected"), out bool isSelected))
            {
                item.IsSelected = isSelected;
            }

            return(item);
        }
Example #2
0
 public void RemoveGUIItem(GUIMenuItem item)
 {
     _GUIItems.Remove(item);
 }
Example #3
0
 public void AddGUIItem(GUIMenuItem item)
 {
     _GUIItems.Add(item);
 }