/// <summary> /// add a new unit conversion item /// </summary> /// <param name="precision"> the precision of the display value</param> /// <param name="ratio"> the radio of inside value to display value about current unit</param> /// <param name="unitName"> the unit of the display value</param> /// <param name="key"></param> private static void AddNewUnit(int precision, double ratio, string unitName, string key) { // create a ConversionValue instance ConversionValue conversionValue = new ConversionValue(precision, ratio, unitName); // add this item to ourself dictionary m_unitDictionary.Add(key, conversionValue); }