示例#1
0
        /// <inheritdoc />
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var text = value as string;
            if (text != null)
            {
                AngularJerkUnit result;
                if (AngularJerkUnit.TryParse(text, out result))
                {
                    return result;
                }

                var message = $"Could not convert the string '{text}' to an instance of AngularJerkUnit)";
                throw new NotSupportedException(message);
            }

            return base.ConvertFrom(context, culture, value);
        }
示例#2
0
 public bool Equals(AngularJerkUnit other)
 {
     return(this.symbol == other.symbol);
 }
示例#3
0
 public static bool TryParse(string text, out AngularJerkUnit result)
 {
     return(UnitParser <AngularJerkUnit> .TryParse(text, out result));
 }