Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
comparison FrmMain.cs @ 197:10ba2c5340b2
Re #343: Show unit requirement failures
* Rework existing dialog box to use new messages
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 May 2011 15:21:13 +0000 |
parents | 15148d255e50 |
children | 53d79e1be712 ac5f87626abd |
comparison
equal
deleted
inserted
replaced
196:15148d255e50 | 197:10ba2c5340b2 |
---|---|
1219 ValidateArmy(); | 1219 ValidateArmy(); |
1220 } | 1220 } |
1221 | 1221 |
1222 private void ValidateArmy() | 1222 private void ValidateArmy() |
1223 { | 1223 { |
1224 if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy))) | 1224 ICollection<string> failureMessages; |
1225 if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy, out failureMessages))) | |
1225 { | 1226 { |
1226 sbErrorPanel.Text = ""; | 1227 sbErrorPanel.Text = ""; |
1227 sbErrorPanel.Tag = ""; | 1228 sbErrorPanel.Tag = ""; |
1228 } | 1229 } |
1229 else | 1230 else |
1230 { | 1231 { |
1231 sbErrorPanel.Text = "Validation errors exist"; | 1232 sbErrorPanel.Text = failureMessages.Count + " validation errors"; |
1232 sbErrorPanel.Tag = "One or more army requirements have not been met"; | 1233 sbErrorPanel.Tag = String.Join("\n", new List<string>(failureMessages).ToArray()); |
1233 } | 1234 } |
1234 } | 1235 } |
1235 | 1236 |
1236 private void FrmMain_UnitRemovedMethod(object unitObj) | 1237 private void FrmMain_UnitRemovedMethod(object unitObj) |
1237 { | 1238 { |