private void writeObject(JSONArray array, DataRow row)
        {
            var obj = new JSONObject();

            foreach (Field field in _fields)
            {
                field.Write(obj, row);
            }

            array.AddObject(obj);
        }
Example #2
0
 public void Write(JSONObject target, DataRow row)
 {
     if (row.IsNull(_index))
     {
         target.AddNull(_name);
     }
     else
     {
         writeProperty(_name, row[_index], target);
     }
 }
Example #3
0
 protected virtual void writeProperty(string name, object rawValue, JSONObject target)
 {
     target.AddString(name, rawValue.ToString().Replace("\n", "~~~").Replace("\r", ""));
 }
Example #4
0
 protected override void writeProperty(string name, object rawValue, JSONObject target)
 {
     target.AddDate(name, (DateTime) rawValue);
 }