private Dictionary <string, DisplayUnitType> GetDisplayUnitTypeDictionary() { if (typeCatelogDisplayUnitTypeDictionary == null) { typeCatelogDisplayUnitTypeDictionary = new Dictionary <string, DisplayUnitType>(); foreach (var displayUnitType in (DisplayUnitType[])Enum.GetValues(typeof(DisplayUnitType))) { var typeCatalogString = string.Empty; try { typeCatalogString = UnitUtils.GetTypeCatalogString(displayUnitType); } catch { } if (!string.IsNullOrEmpty(typeCatalogString)) { typeCatelogDisplayUnitTypeDictionary.Add(typeCatalogString, displayUnitType); } } } return(typeCatelogDisplayUnitTypeDictionary); }
Stream(ArrayList data, FormatOptions opt) { data.Add(new Snoop.Data.ClassSeparator(typeof(FormatOptions))); //data.Add( new Snoop.Data.String( "Name", opt.GetName() ) ); // 2015, jeremy: 'Autodesk.Revit.DB.FormatOptions.GetName()' is obsolete: 'This method is deprecated in Revit 2015. Use UnitUtils.GetTypeCatalogString(DisplayUnitType) instead.' data.Add(new Snoop.Data.String("Name", UnitUtils.GetTypeCatalogString(opt.DisplayUnits))); // 2016 data.Add(new Snoop.Data.Bool("Use default", opt.UseDefault)); if (!opt.UseDefault) { data.Add(new Snoop.Data.String("Units", opt.DisplayUnits.ToString())); data.Add(new Snoop.Data.String("Unit symbol", opt.UnitSymbol.ToString())); data.Add(new Snoop.Data.Double("Rounding", opt.Accuracy)); data.Add(new Snoop.Data.Bool("Suppress trailing zeros", opt.SuppressTrailingZeros)); data.Add(new Snoop.Data.Bool("Suppress leading zeros", opt.SuppressLeadingZeros)); data.Add(new Snoop.Data.Bool("Suppress spaces", opt.SuppressSpaces)); data.Add(new Snoop.Data.Bool("Use plus prefix", opt.UsePlusPrefix)); data.Add(new Snoop.Data.Bool("Use digit grouping", opt.UseDigitGrouping)); } }