Example #1
0
        public static void WriteNewConfig()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.AddPath("ModSwitcherConfig/Settings/DefaultGameFolder");
            xmlDoc.AddPath("ModSwitcherConfig/Settings/GameFile");
            xmlDoc.AddPath("ModSwitcherConfig/Settings/PatchSwitcher");
            xmlDoc.AddPath("ModSwitcherConfig/CurrentMod/ModName");
            xmlDoc.AddPath("ModSwitcherConfig/ModList");

            var gameFileNode = xmlDoc.SelectSingleNode("//ModSwitcherConfig/Settings/GameFile");

            gameFileNode.InnerText = "lotrbfme2ep1.exe";

            var patchSwitcherNode = xmlDoc.SelectSingleNode("//ModSwitcherConfig/Settings/PatchSwitcher");

            patchSwitcherNode.InnerText = "202_launcher.exe";

            var modNameNode = xmlDoc.SelectSingleNode("//ModSwitcherConfig/CurrentMod/ModName");

            modNameNode.InnerText = string.Empty;

            xmlDoc.Save("config.xml");
        }