예제 #1
0
        public static ForceUnitType GetUnitAsEnum(string unitString)
        {
            IDictionaryEnumerator myEnumerator = unitStringTable.GetEnumerator();
            String        name;
            ForceUnitType type = ForceUnitType.Newton;

            while (myEnumerator.MoveNext())
            {
                name = myEnumerator.Value as String;
                if (name.Equals(unitString))
                {
                    type = (ForceUnitType)myEnumerator.Key;
                    break;
                }
            }
            return(type);
        }
예제 #2
0
        public static double ConvertFromSIValue(ForceUnitType unitType, double newtonValue)
        {
            double convertionCoeff = (double)coeffTable[unitType];

            return(newtonValue / convertionCoeff);
        }
예제 #3
0
 public static string GetUnitAsString(ForceUnitType unitType)
 {
     return(unitStringTable[unitType] as String);
 }
예제 #4
0
        public static double ConvertToSIValue(ForceUnitType unitType, double toBeConvertedValue)
        {
            double convertionCoeff = (double)coeffTable[unitType];

            return(convertionCoeff * toBeConvertedValue);
        }