annotate UI/StatsDataGridViewCell.cs @ 242:ea5cb50ebe5e

Fixes #384: Validation warnings don't get cleared when creating new armies * Check whether army is valid when it changes (also means we validate on load as well as clearing on close)
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Jan 2012 16:51:07 +0000
parents 540c8aa6e565
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
151
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (StatsDataGridViewCell.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2010 IBBoard.
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using System.ComponentModel;
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 using System.Windows.Forms;
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 using IBBoard.WarFoundry.API.Objects;
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 namespace IBBoard.WarFoundry.GUI.WinForms.UI
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 {
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 public class StatsDataGridViewCell : DataGridViewTextBoxCell
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 protected override Object GetFormattedValue(Object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 {
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 return value == null ? "" : ((Stat)value).SlotValueString;
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 }
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 }
540c8aa6e565 Re #269: Handle multiple stat lines
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 }