private void BtnSave_Click(object sender, EventArgs e) { string installFolder = Properties.Settings.Default.installLocation; if (Directory.Exists(installFolder + "\\Community\\Tree-Editor\\vegetation") == false) { Directory.CreateDirectory(installFolder + "\\Community\\Tree-Editor\\vegetation"); } xmlBiomes.Save(Properties.Settings.Default.xmlFileBiomes); int xmlFileSize = (int)new FileInfo(Properties.Settings.Default.xmlFileBiomes).Length; LayoutJson layout = new LayoutJson(); layout.setSize(xmlFileSize); File.WriteAllText(Properties.Settings.Default.layoutFile, layout.getJson()); if (File.Exists(Properties.Settings.Default.xmlFile)) { xmlFileSize += (int)new FileInfo(Properties.Settings.Default.xmlFile).Length; } if (File.Exists(Properties.Settings.Default.xmlFileBiomesCities)) { xmlFileSize += (int)new FileInfo(Properties.Settings.Default.xmlFileBiomesCities).Length; } Manifest manifest = new Manifest(); manifest.setSize(xmlFileSize); File.WriteAllText(Properties.Settings.Default.manifestFile, manifest.getJson()); }