public static StartmenuXmlFile Load(string fileName) { var sxf = new StartmenuXmlFile { FileName = fileName, _doc = new XmlDocument() }; //sxf._xmlFile = File.Open(fileName, FileMode.Open, FileAccess.ReadWrite); sxf._doc.Load(sxf.FileName); var root = sxf._doc.DocumentElement; // ReSharper disable once PossibleNullReferenceException sxf._visualElements = (XmlElement)(root.GetElementsByTagName("VisualElements")[0]); sxf.ColorStr = sxf._visualElements.Attributes["BackgroundColor"].Value; sxf.ShowTitleOnLargeIcon = sxf._visualElements.Attributes["ShowNameOnSquare150x150Logo"].Value == "on"; sxf.TxtForeground = sxf._visualElements.Attributes["ForegroundText"].Value == "light" ? TextCol.light : TextCol.dark; if (sxf._visualElements.HasAttribute("Square150x150Logo")) { sxf.LargeLogoLoc = sxf._visualElements.Attributes["Square150x150Logo"].Value; } if (sxf._visualElements.HasAttribute("Square70x70Logo")) { sxf.SmallLogoLoc = sxf._visualElements.Attributes["Square70x70Logo"].Value; } return(sxf); }
public void LoadXmlInfo() { if (XmlDefined) { XmlFile = StartmenuXmlFile.Load(XmlFileLocation); } }