Пример #1
0
        private static bool tryParseByName(string name, out Quantity result)
        {
            result = MetricSystemManager.GetAllQuantities().FirstOrDefault(q => q.Name == name);
            if (result == null)
            {
                return(false);
            }

            return(true);
        }
Пример #2
0
        private static bool tryParseByUISymbol(string uiSymbol, out Quantity result)
        {
            result = MetricSystemManager.GetAllQuantities().FirstOrDefault(q => q.UISymbol == uiSymbol);
            if (result == null)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
 /// <summary>
 /// Gets all the available quantitites.
 /// </summary>
 /// <returns>The available quantities.</returns>
 public static IEnumerable <Quantity> GetAll()
 => MetricSystemManager.GetAllQuantities();