public void SaveAll() { List <RecordLite> records = MakeRecords(); ConfirmSaveDialog csd = new ConfirmSaveDialog(); bool?result = csd.ShowDialog(); if (result == true) { string rootFolder = csd.SelectedPath; if (!rootFolder.EndsWith("\\")) { rootFolder += "\\"; } if (!Directory.Exists(rootFolder)) { Directory.CreateDirectory(rootFolder); } foreach (RecordLite rec in records) { string teamFolder = rootFolder + rec.TeamID.ToString() + "\\"; if (!Directory.Exists(teamFolder)) { Directory.CreateDirectory(teamFolder); } string recordPath = teamFolder + "Match" + rec.MatchID.ToString("00") + ScoutingJson.LiteRecordExtension; ScoutingJson.SaveLiteRecord(rec, recordPath); } } }