// /** // * File: JSONDictionaryMapping.cs // * Author: haraldwolff // * // * This file and it's content is copyrighted by the Author and / or copyright holder. // * Any use wihtout proper permission is illegal and may lead to legal actions. // * // * // **/ using System; using System.Collections.Generic; namespace ln.json.mapping { public class JSONDictionaryMapping : JSONMapping { public JSONDictionaryMapping() :base(typeof(Dictionary)) { } public override JSONValue ToJson(JSONMapper mapper, object value) { JSONObject jObject = new JSONObject(); foreach (KeyValuePair item in (Dictionary)value) { jObject[item.Key.ToString()] = mapper.ToJson(item.Value); } return jObject; } public override object FromJson(JSONMapper mapper, JSONValue json) { return null; } } }