public void FromXml(XmlNode node) { //this.GuiMenuId = node.SelectSingleNode("GuiMenuId").InnerText; this.Text = node.SelectSingleNode("Text").InnerText; this.Font = node.SelectSingleNode("Font").InnerText; this.ForeColor = StructXml.ColorFromXml(node.SelectSingleNode("ForeColor").InnerText); this.TextFormat = (DrawTextFormat)DrawTextFormat.Parse(typeof(DrawTextFormat), node.SelectSingleNode("TextFormat").InnerText); this.ButtonRect = StructXml.RectangleFromXml(node.SelectSingleNode("ButtonRect")); this.Tooltip = node.SelectSingleNode("Tooltip").InnerText; this.Params.Clear(); foreach (XmlNode xPar in node.SelectSingleNode("Params").ChildNodes) { GuiButtonParam par = GuiButtonParam.InvokeCreate(xPar.Attributes["Type"].Value); par.FromXml(xPar); this.Params.Add(xPar.Name, par); } this.Picture = node.SelectSingleNode("Picture").InnerText; this.PictureColor = StructXml.ColorFromXml(node.SelectSingleNode("PictureColor").InnerText); this.Enabled = bool.Parse(node.SelectSingleNode("Enabled").InnerText); this.AnimationFrames = int.Parse(node.SelectSingleNode("AnimationFrames").InnerText); this.AnimationTime = int.Parse(node.SelectSingleNode("AnimationTime").InnerText); }
public GuiButtonInfo(string guiMenuId, string text, string font, Color foreColor, DrawTextFormat textFormat, Rectangle buttonRect, string tooltip, string picture, bool enabled) : this() { this.GuiMenuId = guiMenuId; this.Text = text; this.Font = font; this.ForeColor = foreColor; this.TextFormat = textFormat; this.ButtonRect = buttonRect; this.Tooltip = tooltip; this.Picture = picture; this.Enabled = enabled; }