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

CanConvertFrom() public method

Gets a value indicating whether this converter can convert an object in the given source type to an enumeration object using the specified context.

public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext
sourceType Type
return bool
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            if (sourceType == typeof(string))
            {
                return true;
            }
            return base.CanConvertFrom(context, sourceType);
        }