void Initialize() { BuildInfo1 = new BuildInfo(); BuildInfo2 = new BuildInfo(); BuildInfo3 = new BuildInfo(); BuildInfo4 = new BuildInfo(); BuildInfo5 = new BuildInfo(); BuildInfo6 = new BuildInfo(); if (!File.Exists(filePath)) CreateDefaultFile(); Update(); }
private void ReadFromFile() { var jsonString = File.ReadAllText(filePath); var jObject = JObject.Parse(jsonString); var jBuilds = jObject["Builds"].Values<string>().ToList(); BuildInfo1 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[0]); BuildInfo2 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[1]); BuildInfo3 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[2]); BuildInfo4 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[3]); BuildInfo5 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[4]); BuildInfo6 = JsonConvert.DeserializeObject<BuildInfo>(jBuilds[5]); }