26 lines
536 B
C#
26 lines
536 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
public static class MiniJsonExtensions
|
||
|
{
|
||
|
public static string toJson(this Hashtable obj)
|
||
|
{
|
||
|
return MiniJSON.jsonEncode(obj);
|
||
|
}
|
||
|
|
||
|
public static string toJson(this Dictionary<string, string> obj)
|
||
|
{
|
||
|
return MiniJSON.jsonEncode(obj);
|
||
|
}
|
||
|
|
||
|
public static ArrayList arrayListFromJson(this string json)
|
||
|
{
|
||
|
return MiniJSON.jsonDecode(json) as ArrayList;
|
||
|
}
|
||
|
|
||
|
public static Hashtable hashtableFromJson(this string json)
|
||
|
{
|
||
|
return MiniJSON.jsonDecode(json) as Hashtable;
|
||
|
}
|
||
|
}
|