diff UIControl/Interfaces/IAddEquipmentUI.cs @ 57:293d204e40db

Re #60: Add UI to add/remove/edit weapons in GTK * Make enabling/disabling fit the values passed (copied from existing WinForms checks) * Add extra interface methods and properties to get necessary values from UI to use in command * Implement new interface methods * Implement command execution * Make use of IDisposable interface instead of defining Dispose ourselves Also: * Use existing method of printing exception stack traces in main window
author IBBoard <dev@ibboard.co.uk>
date Thu, 26 Aug 2010 19:30:22 +0000
parents 0c5fbb54bfb0
children e7ad676a7344
line wrap: on
line diff
--- a/UIControl/Interfaces/IAddEquipmentUI.cs	Wed Aug 25 20:04:27 2010 +0000
+++ b/UIControl/Interfaces/IAddEquipmentUI.cs	Thu Aug 26 19:30:22 2010 +0000
@@ -8,7 +8,7 @@
 	/// <summary>
 	/// The interface that UI components should implement to represent "Add Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments)
 	/// </summary>
-	public interface IAddEquipmentUI
+	public interface IAddEquipmentUI : IDisposable
 	{
 		/// <summary>
 		/// Should be fired when unit equipment item choice changes.
@@ -58,19 +58,38 @@
 		/// <code>true</code> if the control was closed with "Okay", else <code>false</code>
 		/// </returns>
 		bool ShowControl();
-	
+		
 		/// <summary>
-		/// Releases all resource used by the <see cref="IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces.IAddEquipmentUI"/> object.
+		/// Gets the selected equipment item.
+		/// </summary>
+		/// <value>
+		/// The selected equipment item.
+		/// </value>
+		UnitEquipmentItem SelectedUnitEquipmentItem { get; }
+		
+		/// <summary>
+		/// Gets a value indicating whether the equipment amount is a ratio or an absolute number.
 		/// </summary>
-		/// <remarks>
-		/// Call <see cref="Dispose"/> when you are finished using the
-		/// <see cref="IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces.IAddEquipmentUI"/>. The <see cref="Dispose"/> method
-		/// leaves the <see cref="IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces.IAddEquipmentUI"/> in an unusable state.
-		/// After calling <see cref="Dispose"/>, you must release all references to the
-		/// <see cref="IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces.IAddEquipmentUI"/> so the garbage collector can reclaim
-		/// the memory that the <see cref="IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces.IAddEquipmentUI"/> was occupying.
-		/// </remarks>
-		void Dispose();
+		/// <value>
+		/// <c>true</c> if the selected amount is a ratio type (percentage or "all"); otherwise, <c>false</c>.
+		/// </value>
+		bool IsRatioEquipmentAmount { get; }
+		
+		/// <summary>
+		/// Gets the numeric amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>true</code>
+		/// </summary>
+		/// <value>
+		/// The absolue number of items taken.
+		/// </value>
+		int EquipmentNumericAmount { get; }
+
+		/// <summary>
+		/// Gets the percentage amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>false</code>
+		/// </summary>
+		/// <value>
+		/// The number of items taken as a percentage of the unit size.
+		/// </value>
+		double EquipmentPercentageAmount { get; }
 	}
 }