Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
comparison FrmMain.cs @ 74:f1b7a08a8f6f
Re #177: "Crash" when equipmenttag
* Show custom dialog instead of crashing
Exception messages could still be improved and translatable
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 28 Sep 2009 19:56:50 +0000 |
parents | 12f11e3c6261 |
children | c243b043aa62 |
comparison
equal
deleted
inserted
replaced
73:12f11e3c6261 | 74:f1b7a08a8f6f |
---|---|
569 FrmNewArmy newArmy = new FrmNewArmy(CurrentGameSystem); | 569 FrmNewArmy newArmy = new FrmNewArmy(CurrentGameSystem); |
570 DialogResult dr = newArmy.ShowDialog(); | 570 DialogResult dr = newArmy.ShowDialog(); |
571 | 571 |
572 if (dr == DialogResult.OK) | 572 if (dr == DialogResult.OK) |
573 { | 573 { |
574 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); | 574 try |
575 { | |
576 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); | |
577 } | |
578 catch (RequiredDataMissingException ex) | |
579 { | |
580 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
581 } | |
582 catch (InvalidFileException ex) | |
583 { | |
584 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); | |
585 } | |
575 } | 586 } |
576 } | 587 } |
577 } | 588 } |
578 | 589 |
579 private bool OpenArmy() | 590 private bool OpenArmy() |