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;