public static void SaveAnalysis(EventAnalysis stats, string path) { Initialize(false); string contents = JsonConvert.SerializeObject(stats, Formatting.Indented); File.WriteAllText(path, contents); }
public void LoadCreateAnalysis() { string analysisPath = EventPath + "\\" + Event.EventName + ScoutingJson.AnalysisExtension; if (File.Exists(analysisPath)) { FrcAnalysis = ScoutingJson.ParseAnalysis(analysisPath); } else { FrcAnalysis = new EventAnalysis(Event); } FrcAnalysis.PostJsonLoading(Event); }
public static EventAnalysis ParseAnalysis(string fullPathName) { Initialize(false); string contents = File.ReadAllText(fullPathName); EventAnalysis stats = null; try { stats = JsonConvert.DeserializeObject <EventAnalysis>(contents); } catch (JsonException) { Util.DebugLog(LogLevel.Critical, "Could not deserialize file."); } return(stats); }