コード例 #1
0
        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);
        }
コード例 #2
0
        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");
        }
コード例 #3
0
 public static void WriteToDirectory(SettingsData data, string directory)
 {
     data.Category = SettingCategory.package;
     XmlSettingsParser.Write(data, directory.AppendPath(FILE));
 }