public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var text = value as string;

            if (text != null)
            {
                return(MolarHeatCapacity.Parse(text, culture));
            }

            return(base.ConvertFrom(context, culture, value));
        }
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            var attribute = reader.GetAttribute("Value");

            if (attribute is null)
            {
                throw new XmlException($"Could not find attribute named: Value");
            }

            this = new MolarHeatCapacity(XmlConvert.ToDouble(attribute), MolarHeatCapacityUnit.JoulesPerKelvinMole);
            reader.ReadStartElement();
        }
 public bool Equals(MolarHeatCapacity other, MolarHeatCapacity tolerance)
 {
     Ensure.GreaterThan(tolerance.joulesPerKelvinMole, 0, nameof(tolerance));
     return(Math.Abs(this.joulesPerKelvinMole - other.joulesPerKelvinMole) < tolerance.joulesPerKelvinMole);
 }
 public bool Equals(MolarHeatCapacity other)
 {
     return(this.joulesPerKelvinMole.Equals(other.joulesPerKelvinMole));
 }
 public int CompareTo(MolarHeatCapacity quantity)
 {
     return(this.joulesPerKelvinMole.CompareTo(quantity.joulesPerKelvinMole));
 }
 public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out MolarHeatCapacity result)
 {
     return(QuantityParser.TryParse <MolarHeatCapacityUnit, MolarHeatCapacity>(text, From, styles, provider, out result));
 }
 public static bool TryParse(string text, NumberStyles styles, out MolarHeatCapacity result)
 {
     return(QuantityParser.TryParse <MolarHeatCapacityUnit, MolarHeatCapacity>(text, From, styles, CultureInfo.CurrentCulture, out result));
 }