Example #1
0
 public void LoadFromXmlNode(XmlNode rootNode)
 {
     this.ID          = int.Parse(rootNode.Attributes.GetNamedItem("ID").Value);
     this.Name        = rootNode.Attributes.GetNamedItem("Name").Value;
     this.DisplayName = rootNode.Attributes.GetNamedItem("DisplayName").Value;
     this.DefaultName = this.DisplayName;
     if (rootNode.Attributes.GetNamedItem("DisplayIfTrue") != null)
     {
         this.DisplayIfTrue = rootNode.Attributes.GetNamedItem("DisplayIfTrue").Value;
     }
     if (rootNode.Attributes.GetNamedItem("DisplayAll") != null)
     {
         this.DisplayAll = bool.Parse(rootNode.Attributes.GetNamedItem("DisplayAll").Value);
     }
     if (rootNode.Attributes.GetNamedItem("IsParamIDItem") != null)
     {
         this.IsParamIDItem = bool.Parse(rootNode.Attributes.GetNamedItem("IsParamIDItem").Value);
     }
     if (rootNode.Attributes.GetNamedItem("Param") != null)
     {
         this.Param = rootNode.Attributes.GetNamedItem("Param").Value;
     }
     if (rootNode.Attributes.GetNamedItem("ChangeDisplayName") != null)
     {
         this.ChangeDisplayName = rootNode.Attributes.GetNamedItem("ChangeDisplayName").Value;
     }
     if (rootNode.Attributes.GetNamedItem("OppositeName") != null)
     {
         this.OppositeName = rootNode.Attributes.GetNamedItem("OppositeName").Value;
     }
     if (rootNode.Attributes.GetNamedItem("OppositeIfTrue") != null)
     {
         this.OppositeIfTrue = rootNode.Attributes.GetNamedItem("OppositeIfTrue").Value;
     }
     if (rootNode.Attributes.GetNamedItem("DisplayPlatform") != null)
     {
         this.DisplayPlatform = rootNode.Attributes.GetNamedItem("DisplayPlatform").Value;
     }
     foreach (XmlNode node in rootNode)
     {
         MenuItem item = new MenuItem(this, this.menuKind, this.contextMenu);
         item.LoadFromXmlNode(node);
         this.MenuItems.Add(item);
     }
 }
 internal void LoadFromXmlNode(XmlNode rootNode)
 {
     this.ID          = int.Parse(rootNode.Attributes.GetNamedItem("ID").Value);
     this.Name        = rootNode.Attributes.GetNamedItem("Name").Value;
     this.DisplayName = rootNode.Attributes.GetNamedItem("DisplayName").Value;
     this.IsLeft      = bool.Parse(rootNode.Attributes.GetNamedItem("IsLeft").Value);
     this.ItemWidth   = int.Parse(rootNode.Attributes.GetNamedItem("Width").Value);
     this.ItemHeight  = int.Parse(rootNode.Attributes.GetNamedItem("Height").Value);
     if (rootNode.Attributes.GetNamedItem("DisplayIfTrue") != null)
     {
         this.DisplayIfTrue = rootNode.Attributes.GetNamedItem("DisplayIfTrue").Value;
     }
     if (rootNode.Attributes.GetNamedItem("DisplayAll") != null)
     {
         this.DisplayAll = bool.Parse(rootNode.Attributes.GetNamedItem("DisplayAll").Value);
     }
     foreach (XmlNode node in rootNode)
     {
         MenuItem item = new MenuItem(this, this.contextMenu);
         item.IsRootItem = true;
         item.LoadFromXmlNode(node);
         this.MenuItems.Add(item);
     }
 }
Example #3
0
 internal void LoadFromXmlNode(XmlNode rootNode)
 {
     this.ID = int.Parse(rootNode.Attributes.GetNamedItem("ID").Value);
     this.Name = rootNode.Attributes.GetNamedItem("Name").Value;
     this.DisplayName = rootNode.Attributes.GetNamedItem("DisplayName").Value;
     this.DefaultName = this.DisplayName;
     if (rootNode.Attributes.GetNamedItem("DisplayIfTrue") != null)
     {
         this.DisplayIfTrue = rootNode.Attributes.GetNamedItem("DisplayIfTrue").Value;
     }
     if (rootNode.Attributes.GetNamedItem("DisplayAll") != null)
     {
         this.DisplayAll = bool.Parse(rootNode.Attributes.GetNamedItem("DisplayAll").Value);
     }
     if (rootNode.Attributes.GetNamedItem("IsParamIDItem") != null)
     {
         this.IsParamIDItem = bool.Parse(rootNode.Attributes.GetNamedItem("IsParamIDItem").Value);
     }
     if (rootNode.Attributes.GetNamedItem("Param") != null)
     {
         this.Param = rootNode.Attributes.GetNamedItem("Param").Value;
     }
     if (rootNode.Attributes.GetNamedItem("ChangeDisplayName") != null)
     {
         this.ChangeDisplayName = rootNode.Attributes.GetNamedItem("ChangeDisplayName").Value;
     }
     if (rootNode.Attributes.GetNamedItem("OppositeName") != null)
     {
         this.OppositeName = rootNode.Attributes.GetNamedItem("OppositeName").Value;
     }
     if (rootNode.Attributes.GetNamedItem("OppositeIfTrue") != null)
     {
         this.OppositeIfTrue = rootNode.Attributes.GetNamedItem("OppositeIfTrue").Value;
     }
     foreach (XmlNode node in rootNode)
     {
         MenuItem item = new MenuItem(this, this.menuKind, this.contextMenu);
         item.LoadFromXmlNode(node);
         this.MenuItems.Add(item);
     }
 }
Example #4
0
 internal void LoadFromXmlNode(XmlNode rootNode)
 {
     this.ID = int.Parse(rootNode.Attributes.GetNamedItem("ID").Value);
     this.Name = rootNode.Attributes.GetNamedItem("Name").Value;
     this.DisplayName = rootNode.Attributes.GetNamedItem("DisplayName").Value;
     this.IsLeft = bool.Parse(rootNode.Attributes.GetNamedItem("IsLeft").Value);
     this.ItemWidth = int.Parse(rootNode.Attributes.GetNamedItem("Width").Value);
     this.ItemHeight = int.Parse(rootNode.Attributes.GetNamedItem("Height").Value);
     if (rootNode.Attributes.GetNamedItem("DisplayIfTrue") != null)
     {
         this.DisplayIfTrue = rootNode.Attributes.GetNamedItem("DisplayIfTrue").Value;
     }
     if (rootNode.Attributes.GetNamedItem("DisplayAll") != null)
     {
         this.DisplayAll = bool.Parse(rootNode.Attributes.GetNamedItem("DisplayAll").Value);
     }
     foreach (XmlNode node in rootNode)
     {
         MenuItem item = new MenuItem(this, this.contextMenu);
         item.IsRootItem = true;
         item.LoadFromXmlNode(node);
         this.MenuItems.Add(item);
     }
 }