System.ComponentModel.TypeListConverter.ConvertFrom C# (CSharp) Method

ConvertFrom() public method

Converts the specified value object to an enumeration object.

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
return object
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value is string)
            {
                foreach (Type t in _types)
                {
                    if (value.Equals(t.FullName))
                    {
                        return t;
                    }
                }
            }

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