예제 #1
0
        private static bool tryParseByName(string name, out Unit result)
        {
            result = MetricSystemManager.GetAllUnits().FirstOrDefault(u => u.Name == name);
            if (result == default)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        private static bool tryParseByUISymbol(string uiSymbol, out Unit result)
        {
            result = MetricSystemManager.GetAllUnits().FirstOrDefault(u => u.UISymbol == uiSymbol);
            if (result == default)
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
 /// <summary>
 /// Gets all the available units.
 /// </summary>
 /// <returns>The available units.</returns>
 public static IEnumerable <Unit> GetAll() => MetricSystemManager.GetAllUnits();