public Widget(XElement e, ContainerWidget parentNode) { this.Name = e.Element("Name").Value; this.TreeNode = new TreeNode(this.Name); if (this is ContainerWidget) { this.TreeNode.ImageIndex = 0; this.TreeNode.SelectedImageIndex = 0; } else { this.TreeNode.ImageIndex = 1; this.TreeNode.SelectedImageIndex = 1; } this.ParentNode = parentNode; this.TreeNode.Tag = this; if (parentNode != null) { parentNode.TreeNode.Nodes.Add(this.TreeNode); } XElement rectangle = e.Element("Rectangle"); this.PositionAndSize = XmlConverter.ToRectangleF(rectangle); this.IsShown = bool.Parse(e.Element("IsShown").Value); this.Visible = this.IsShown; this.TreeNode.Checked = this.IsShown; this.ZPriority = float.Parse(e.Element("ZPriority").Value); this.Group = e.Element("Group").Value; this.ForceToHandleMouseEventsFlag = bool.Parse(e.Element("ForceToHandleMouseEventsFlag").Value); this.ForceToNeverBeFoundFlag = bool.Parse(e.Element("ForceToNeverBeFoundFlag").Value); }
public Texture(XElement e) { this.TexturePath = e.Element("Texture").Value; this.TexturePosAndSize = XmlConverter.ToRectangleF(e.Element("TextureCoordinates")); this.RGBA = XmlConverter.ToColor(e.Element("Color")); }