private bool LoadFile(String filename) { bool retval = false; try { Autonomous_x.PlayGroup playList = null; playList = Autonomous_x.PlayGroup.Load(filename); if (playList != null) { SaveFilename = filename; AddNewPlay(playList); } retval = true; } catch (Exception ex) { String msg = String.Format("Unable to load JSON file\n{0}", ex.Message); MessageBox.Show(msg, "Error", MessageBoxButton.OK, MessageBoxImage.Error); retval = false; } return(retval); }
public static PlayGroup Load(String filepath) { PlayGroup retval = null; using (StreamReader sr = new StreamReader(filepath)) { String json; json = sr.ReadToEnd(); retval = JsonConvert.DeserializeObject <PlayGroup>(json); } return(retval); }
private void AddNewPlay(Autonomous_x.PlayGroup playsList) { mPlays = playsList; UpdatePlayList(); PlaysLB.SelectedIndex = 0; }
private void AddNewRoute(Autonomous_x.PlayGroup playsList) { mPlays = playsList; UpdatePlayList(); //ProgramModeLB.SelectedIndex = 0; }