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 static GuiButtonParam InvokeCreate(string typ) { GuiButtonParam si = StructXml.CreateInstanceFromType(typ) as GuiButtonParam; if (si == null) { return(new GuiButtonParamDoNothing()); } else { return(si); } }