Cim.Eap.EapDriverConverter.ConvertFrom C# (CSharp) Method

ConvertFrom() public method

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) {
            Type type = (Type)typeNameConverter.ConvertFrom(context, culture, value);
            if (!type.IsClass) throw new ConfigurationErrorsException(type.FullName + "不是類別");
            validator.Validate(type);
            return Activator.CreateInstance(type);
        }
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) => value.GetType().AssemblyQualifiedName;