Exemplo n.º 1
0
 /// <summary>
 /// Gets an array of <var>T</var> from the specified JSON string.
 /// </summary>
 /// <param name="json">The JSON string representation of the array.</param>
 /// <param name="func">The function used to parse the array.</param>
 public static T[] ParseJson <T>(string json, Func <JsonArray, T[]> func)
 {
     return(JsonConverter.ParseArray(json, func));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Load an array of <var>T</var> from the JSON file at the specified <var>path</var>.
 /// </summary>
 /// <param name="path">The path to the file.</param>
 /// <param name="func">The function used to parse the array.</param>
 public static T[] LoadJson <T>(string path, Func <JsonArray, T[]> func)
 {
     return(JsonConverter.ParseArray(File.ReadAllText(path), func));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Gets an instance of <var>JsonObject</var> from the specified JSON string.
 /// </summary>
 /// <param name="json">The JSON string representation of the array.</param>
 public static JsonArray ParseJson(string json)
 {
     return(JsonConverter.ParseArray(json));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Load an instance of <var>JsonObject</var> from the JSON file at the specified <var>path</var>.
 /// </summary>
 /// <param name="path">The path to the file.</param>
 public static JsonArray LoadJson(string path)
 {
     return(JsonConverter.ParseArray(File.ReadAllText(path)));
 }