public static void SerializeToFile(string fileName, ExportedBattle battle) { // Save the version for local editing. Directory.CreateDirectory(UiHelper.GetParentFolder(fileName)); using (var writer = new StreamWriter(fileName)) { var serial = new JsonSerializer(); serial.Formatting = Newtonsoft.Json.Formatting.Indented; serial.Serialize(writer, battle); } }
public static string ToDefaultBattleExportFolder(string filename) { return(UiHelper.GetParentFolder(filename)); }