private static bool tryParseByName(string name, out Quantity result) { result = MetricSystemManager.GetAllQuantities().FirstOrDefault(q => q.Name == name); if (result == null) { return(false); } return(true); }
private static bool tryParseByUISymbol(string uiSymbol, out Quantity result) { result = MetricSystemManager.GetAllQuantities().FirstOrDefault(q => q.UISymbol == uiSymbol); if (result == null) { return(false); } return(true); }
/// <summary> /// Gets all the available quantitites. /// </summary> /// <returns>The available quantities.</returns> public static IEnumerable <Quantity> GetAll() => MetricSystemManager.GetAllQuantities();