diff api/Commands/RemoveUnitCommand.cs @ 289:650bbe79b884 WarFoundry_v0.1

Fixes #336: Command descriptions don't refresh on language change * Remove cached string values and just return the text each time
author IBBoard <dev@ibboard.co.uk>
date Sun, 02 Jan 2011 21:01:20 +0000
parents 391446c9b250
children
line wrap: on
line diff
--- a/api/Commands/RemoveUnitCommand.cs	Sun Jan 02 16:04:49 2011 +0000
+++ b/api/Commands/RemoveUnitCommand.cs	Sun Jan 02 21:01:20 2011 +0000
@@ -16,8 +16,6 @@
 	{
 		private Unit unit;
 		private ArmyCategory cat;
-		private string description;
-		private string undoDescription;
 
 		public RemoveUnitCommand(Unit toRemove)
 		{
@@ -27,19 +25,14 @@
 
 		public override bool CanExecute()
 		{
-			return (unit!=null);
+			return (unit != null);
 		}
 
 		public override string Description
 		{
 			get
 			{
-				if (description == null)
-				{
-					description = Translation.GetTranslation("removeUnitCommandDescription", "remove {0} from the army", unit.Name);
-				}
-				
-				return description;
+				return Translation.GetTranslation("removeUnitCommandDescription", "remove {0} from the army", unit.Name);
 			}
 		}
 
@@ -47,12 +40,7 @@
 		{
 			get
 			{
-				if (undoDescription == null)
-				{
-					undoDescription = Translation.GetTranslation("removeUnitCommandUndoDescription", "re-add {0} to the army", unit.Name);
-				}
-				
-				return undoDescription;
+				return Translation.GetTranslation("removeUnitCommandUndoDescription", "re-add {0} to the army", unit.Name);
 			}
 		}