Alsing.Design.Int32AutoConverter.ConvertFrom C# (CSharp) Méthode

ConvertFrom() public méthode

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
Résultat object
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value is string)
            {
                if (value.ToString().ToLower() == "auto")
                    return 0;

                return Convert.ToInt32(value);
            }

            return base.ConvertFrom(context, culture, value);
        }