/// <summary> /// Saves the specified <paramref name="obj"/> to the file at <paramref name="path"/>. If the file doesn't /// already exist, a new file will be created. /// </summary> /// <param name="path">The path to the file.</param> /// <param name="obj">The instance of <see cref="JsonObjectBase"/> to be saved.</param> public static void SaveJsonObject(string path, JsonObjectBase obj) { if (string.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException(nameof(path)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } SaveJsonObject(path, obj, Formatting.None); }
/// <summary> /// Saves the specified <paramref name="obj"/> to the file at <paramref name="path"/>. If the file doesn't /// already exist, a new file will be created. /// </summary> /// <param name="path">The path to the file.</param> /// <param name="obj">The instance of <see cref="JsonObjectBase"/> to be saved.</param> /// <param name="formatting">The formatting to be used when saving the object.</param> public static void SaveJsonObject(string path, JsonObjectBase obj, Formatting formatting) { if (string.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException(nameof(path)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (obj.JObject == null) { throw new PropertyNotSetException(nameof(obj.JObject)); } SaveJsonObject(path, obj.JObject, formatting); }
public static void SaveJsonObject(string path, JsonObjectBase obj, Formatting formatting) { JsonUtils.SaveJsonObject(path, obj, formatting); }
public static void SaveJsonObject(string path, JsonObjectBase obj) { JsonUtils.SaveJsonObject(path, obj); }