SHARE
TWEET

Dispay Unit Type Abbreviation

chekalin-v Nov 16th, 2013 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     [Transaction(TransactionMode.ReadOnly)]
  2.     public class Command : IExternalCommand
  3.     {
  4.         public Result Execute(
  5.           ExternalCommandData commandData,
  6.           ref string message,
  7.           ElementSet elements)
  8.         {
  9.             DisplayUnitType n
  10.       = DisplayUnitType.DUT_GALLONS_US;
  11.            
  12.             string valid_unit_symbols;
  13.  
  14.             for (DisplayUnitType i = DisplayUnitType
  15.               .DUT_METERS; i < n; ++i)
  16.             {
  17.                 var validUnitSymbols = FormatOptions.GetValidUnitSymbols(i);
  18.  
  19.                 foreach (var validUnitSymbol in validUnitSymbols)
  20.                 {
  21.                     if (validUnitSymbol != UnitSymbolType.UST_NONE)
  22.                     {
  23.                         var abbrUnitTypeLabel = LabelUtils.GetLabelFor(validUnitSymbol);
  24.                         Debug.Print("{0} - {1}", abbrUnitTypeLabel, LabelUtils.GetLabelFor(i));
  25.                     }                    
  26.                 }
  27.                
  28.             }
  29.             return Result.Succeeded;
  30.         }
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top