public static XmlObject Load(string path, XmlDefinition def) { var doc = new XmlDocument(); doc.Load(path); return(new XmlObject(doc.DocumentElement, null, def.SelectNode(doc.DocumentElement.Name))); }
internal DataManager() { _names = File.ReadAllLines(Path.Combine("Datasheet", "Names.txt")) .Where(e => !string.IsNullOrWhiteSpace(e)) .Select(e => e.Trim()) .ToArray(); _xmlDef = new XmlDefinition(Path.Combine("Datasheet", "DataDefine.def")); _world = XmlObject.Load(Path.Combine("Datasheet", "World.xml"), _xmlDef); }