public BaseQuantity(string name) { Name = name ?? throw new ArgumentNullException(nameof(name)); Symbol = null; UISymbol = null; MetricSystemManager.AddQuantity(this); }
public MetricSystem(string name) { Name = name ?? throw new ArgumentNullException(nameof(name)); units = new HashSet <Unit>(); prefixes = new HashSet <MetricPrefix>(); MetricSystemManager.AddMetricSystem(this); }
public MetricSystem(string name, IList <Unit> units) { Name = name ?? throw new ArgumentNullException(nameof(name)); FullName = null; this.units = new HashSet <Unit>(units ?? throw new ArgumentNullException(nameof(units))); prefixes = new HashSet <MetricPrefix>(); MetricSystemManager.AddMetricSystem(this); }
private static bool tryParseByFullName(string uiSymbol, out MetricPrefix result) { result = MetricSystemManager.GetAllMetricPrefixes().FirstOrDefault(u => u.UISymbol == uiSymbol); if (result == default) { return(false); } return(true); }
private static bool tryParseByFullName(string uiSymbol, out MetricSystem result) { result = MetricSystemManager.GetAllMetricSystems() .FirstOrDefault(ms => ms.FullName == uiSymbol); if (result == default) { return(false); } return(true); }
private static bool tryParseByName(string name, out Unit result) { result = MetricSystemManager.GetAllUnits().FirstOrDefault(u => u.Name == name); if (result == default) { return(false); } return(true); }
private static bool tryParseByUISymbol(string uiSymbol, out Unit result) { result = MetricSystemManager.GetAllUnits().FirstOrDefault(u => u.UISymbol == uiSymbol); if (result == default) { return(false); } return(true); }
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); }
private static bool tryParseBySymbol(string symbol, out MetricPrefix result) { result = MetricSystemManager.GetAllMetricPrefixes().FirstOrDefault(q => q.Symbol == symbol); if (result == null) { return(false); } return(true); }
public void Dispose() { MetricSystemManager.RemoveMetricSystem(this); }
/// <summary> /// Gets all the available metric systems. /// </summary> /// <returns>The available metric systems.</returns> public static IEnumerable <MetricSystem> GetAll() => MetricSystemManager.GetAllMetricSystems();
public override void Dispose() { MetricSystemManager.RemoveQuantity(this); }
/// <summary> /// Gets all the available units. /// </summary> /// <returns>The available units.</returns> public static IEnumerable <Unit> GetAll() => MetricSystemManager.GetAllUnits();
/// <summary> /// Gets all the available quantitites. /// </summary> /// <returns>The available quantities.</returns> public static IEnumerable <Quantity> GetAll() => MetricSystemManager.GetAllQuantities();
/// <summary> /// Gets all the available metric prefixes. /// </summary> /// <returns>The available metric prefixes.</returns> public static IEnumerable <MetricPrefix> GetAll() => MetricSystemManager.GetAllMetricPrefixes();