diff api/Commands/SetNameCommand.cs @ 298:483b491d18f4

Fixes #337: Merge API v0.1.1 changes into v0.2 * Merge translation-related changes from v0.1.1 branch
author IBBoard <dev@ibboard.co.uk>
date Mon, 17 Jan 2011 20:02:41 +0000
parents 391446c9b250
children
line wrap: on
line diff
--- a/api/Commands/SetNameCommand.cs	Fri Jan 07 03:35:50 2011 +0000
+++ b/api/Commands/SetNameCommand.cs	Mon Jan 17 20:02:41 2011 +0000
@@ -16,8 +16,6 @@
 	{
 		private WarFoundryObject obj;
 		private string newName, oldName;
-		private string description;
-		private string undoDescription;		
 
 		public SetNameCommand(WarFoundryObject toRename, string name)
 		{
@@ -28,19 +26,14 @@
 
 		public override bool CanExecute()
 		{
-			return (obj!=null && newName!=null && newName!="");
+			return (obj != null && newName != null && newName != "");
 		}
 
 		public override string Description
 		{
 			get
 			{
-				if (description == null)
-				{
-					description = Translation.GetTranslation("setUnitNameCommandDescription", "rename \"{0}\" to \"{1}\"", oldName, newName);
-				}
-				
-				return description;
+				return Translation.GetTranslation("setUnitNameCommandDescription", "rename \"{0}\" to \"{1}\"", oldName, newName);
 			}
 		}
 
@@ -48,12 +41,7 @@
 		{
 			get
 			{
-				if (undoDescription == null)
-				{
-					undoDescription = Translation.GetTranslation("setUnitNameCommandUndoDescription", "rename \"{0}\" to \"{1}\"", newName, oldName);
-				}
-				
-				return undoDescription;
+				return Translation.GetTranslation("setUnitNameCommandUndoDescription", "rename \"{0}\" to \"{1}\"", newName, oldName);
 			}
 		}