public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { var text = value as string; if (text != null) { MolarHeatCapacityUnit result; if (MolarHeatCapacityUnit.TryParse(text, out result)) { return(result); } var message = $"Could not convert the string '{text}' to an instance of MolarHeatCapacityUnit)"; throw new NotSupportedException(message); } return(base.ConvertFrom(context, culture, value)); }
public bool Equals(MolarHeatCapacityUnit other) { return(this.symbol == other.symbol); }
public static bool TryParse(string text, out MolarHeatCapacityUnit result) { return(UnitParser <MolarHeatCapacityUnit> .TryParse(text, out result)); }