void UpdateModLoadConfig() { ModLoadConfig newModLoadConfig = new ModLoadConfig(); XmlSerializer serializer = new XmlSerializer(typeof(ModLoadConfig)); FileStream stream = new FileStream(modFolderPath + "ModLoadConfig.xml", FileMode.Create); for (int i = 0; i < ModList.Items.Count; i++) { newModLoadConfig.ModLoadOrder.Add(new ModLoadConfig.ModEntry(ModList.GetItemText(ModList.Items[i]), ModList.GetItemChecked(i))); } serializer.Serialize(stream, newModLoadConfig); stream.Close(); }