Ejemplo n.º 1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            JArray             arr  = new JArray();
            RWMSDBCategoryInfo info = (RWMSDBCategoryInfo)value;

            arr.Add(info.Weight);
            arr.Add(info.Description);
            arr.WriteTo(writer);
        }
Ejemplo n.º 2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var arr = JArray.Load(reader);
            var ret = new RWMSDBCategoryInfo();

            ret.Weight      = (decimal)arr[0];
            ret.Description = (string)arr[1];
            return(ret);
        }