public SkipperForm() { try { //throw new Exception("Don't load from the file during debugging"); Persistance.LoadFromFile(); } catch { Persistance.CreateNew(); } SelectRace sr = new SelectRace(); sr.ShowDialog(); Race r = sr.SelectedRace; EditRace er = new EditRace(r); er.ShowDialog(); //Persistance.SaveToFile(); InitializeComponent(); viewPanel.Initialize(r, new Notify(this.RequestStatisticsUpdate)); foreach (AmphibianSoftware.Skipper.Data.Boat b in r.Boats) { boatsLB.Items.Add(b); } boatsLB.SelectedIndex = 0; this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); _drawThread = new Thread(new ThreadStart(drawLoop)); _drawThread.Start(); }
private void TryLoadFile() { try { BusyDialogManager.Show("Loading " + BusyDialog.CleanPath(_loadedFile)); Persistance.LoadFromFile(_loadedFile); LoadFile(); ConfigureMenu(true); HideGettingStarted(); } catch (Exception ex) { #if NOLICENSE throw; #else ConfigureMenu(false); _loadedFile = string.Empty; MessageBox.Show("A problem occured loading the file." + Environment.NewLine + ex.Message); ShowGettingStarted(); #endif } finally { BusyDialogManager.Hide(); } }