Пример #1
0
        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));
        }
Пример #2
0
 public bool Equals(MolarHeatCapacityUnit other)
 {
     return(this.symbol == other.symbol);
 }
Пример #3
0
 public static bool TryParse(string text, out MolarHeatCapacityUnit result)
 {
     return(UnitParser <MolarHeatCapacityUnit> .TryParse(text, out result));
 }