コード例 #1
0
        public void ConvertToJson(string filename)
        {
            using (var store = FileIndexKeyValueStorageBuilder <string, JObject> .Open(filename, serializer: new JsonSerializer <JObject>()))
            {
                var everything = from key in store.GetKeys()
                                 select new { Key = key, Value = store.Get(key) };

                var everythingJson = JsonConvert.SerializeObject(everything, Formatting.Indented);

                File.WriteAllText(filename + ".keys.json", JsonConvert.SerializeObject(store.GetKeys()));
                File.WriteAllText(filename + ".json", everythingJson);
            }
        }
コード例 #2
0
        public StorageWrapper <string, JObject> File(string filename)
        {
            var store = FileIndexKeyValueStorageBuilder <string, JObject> .Open(filename);

            return(new StorageWrapper <string, JObject>(store));
        }