private void saveData(SettingsData data, string directory, string name) { var file = FileSystem.Combine("geonosis", directory, "config", name + ".config"); new FileSystem().CreateDirectory("geonosis", directory); new FileSystem().CreateDirectory("geonosis", directory, "config"); XmlSettingsParser.Write(data, file); }
public void write_and_read() { var settings = new SettingsData(SettingCategory.package); settings["a"] = "1"; settings["b"] = "2"; XmlSettingsParser.Write(settings, "config.xml"); var settings2 = XmlSettingsParser.Parse("config.xml"); settings2.Category.ShouldEqual(SettingCategory.package); settings2["a"].ShouldEqual("1"); settings2["b"].ShouldEqual("2"); }
public static void WriteToDirectory(SettingsData data, string directory) { data.Category = SettingCategory.package; XmlSettingsParser.Write(data, directory.AppendPath(FILE)); }