@@ -21,13 +21,15 @@ namespace BuildingCoder
2121 [ Transaction ( TransactionMode . ReadOnly ) ]
2222 class CmdDutAbbreviation : IExternalCommand
2323 {
24- const string _s = "unexpected display unit type enumeration sequence" ;
24+ const string _s = "unexpected display unit type "
25+ + "enumeration sequence" ;
2526
2627 public Result Execute (
2728 ExternalCommandData commandData ,
2829 ref string message ,
2930 ElementSet elements )
3031 {
32+ #region Assertions
3133 Debug . Assert ( 0 == ( int ) DisplayUnitType . DUT_METERS , _s ) ;
3234 Debug . Assert ( 1 == ( int ) DisplayUnitType . DUT_CENTIMETERS , _s ) ;
3335 Debug . Assert ( 2 == ( int ) DisplayUnitType . DUT_MILLIMETERS , _s ) ;
@@ -55,14 +57,15 @@ public Result Execute(
5557 Debug . Assert ( 24 == ( int ) DisplayUnitType . DUT_CUBIC_CENTIMETERS , _s ) ;
5658 Debug . Assert ( 25 == ( int ) DisplayUnitType . DUT_CUBIC_MILLIMETERS , _s ) ;
5759 Debug . Assert ( 26 == ( int ) DisplayUnitType . DUT_LITERS , _s ) ;
60+ #endregion // Assertions
5861
59- DisplayUnitType n
62+ DisplayUnitType n
6063 = DisplayUnitType . DUT_GALLONS_US ;
6164
6265 Debug . Print ( "Here is a list of the first {0} "
6366 + "display unit types with The Building Coder "
6467 + "abbreviation and the valid unit symbols:\n " ,
65- ( int ) n ) ;
68+ ( int ) n - 1 ) ;
6669
6770 string valid_unit_symbols ;
6871
@@ -74,8 +77,8 @@ DisplayUnitType n
7477 . Select < UnitSymbolType , string > (
7578 u => Util . UnitSymbolTypeString ( u ) ) ) ;
7679
77- Debug . Print ( "{0,6} - {1}: {2}" ,
78- Util . DisplayUnitTypeAbbreviation [ ( int ) i ] ,
80+ Debug . Print ( "{0,6} - {1}: {2}" ,
81+ Util . DisplayUnitTypeAbbreviation [ ( int ) i ] ,
7982 LabelUtils . GetLabelFor ( i ) ,
8083 //UnitFormatUtils.Format( UnitType. ???
8184 //UnitUtils.ConvertFromInternalUnits( 1, i ),
0 commit comments