//@predefined converter
		public static string fromAnyArray(object value, bool useSingleQuote)
		{
			if (value == null)
			{
				return JsonBuilder.NullStr;
			}
			if ((value.GetType()).IsArray)
			{
				var elems = value as Array;
				var jb = new JsonBuilder(useSingleQuote);
				jb.startArray();
				foreach (object elem in elems)
				{
					jb.addValue(elem);
				}
				jb.endArray();
				return jb.toJSON();
			}
			return JsonBuilder.NullStr;
		}
Example #2
0
 //@predefined converter
 public static string fromAnyArray(object value, bool useSingleQuote)
 {
     if (value == null)
     {
         return(JsonBuilder.NullStr);
     }
     if ((value.GetType()).IsArray)
     {
         var elems = value as Array;
         var jb    = new JsonBuilder(useSingleQuote);
         jb.startArray();
         foreach (object elem in elems)
         {
             jb.addValue(elem);
         }
         jb.endArray();
         return(jb.toJSON());
     }
     return(JsonBuilder.NullStr);
 }
		//@predefined converter
		public static string fromListOfObject(object value, bool useSingleQuote)
		{
			if (value == null)
			{
				return JsonBuilder.NullStr;
			}
			if (value.GetType() == typeof(List<object>))
			{
				var elems = value as List<object>;
				var jb = new JsonBuilder(useSingleQuote);
				jb.startArray();
				foreach (object elem in elems)
				{
					jb.addValue(elem);
				}
				jb.endArray();
				return jb.toJSON();
			}
			return JsonBuilder.NullStr;
		}
Example #4
0
 //@predefined converter
 public static string fromListOfObject(object value, bool useSingleQuote)
 {
     if (value == null)
     {
         return(JsonBuilder.NullStr);
     }
     if (value.GetType() == typeof(List <object>))
     {
         var elems = value as List <object>;
         var jb    = new JsonBuilder(useSingleQuote);
         jb.startArray();
         foreach (object elem in elems)
         {
             jb.addValue(elem);
         }
         jb.endArray();
         return(jb.toJSON());
     }
     return(JsonBuilder.NullStr);
 }