I've been crazy looking for a existing post for a solution... found a few, none helpful to my problem.
I made a new vs project to handle my converters and enums.
I created the ".typeImports" file to declare "type shorcuts" with my enums - all perfect.
So, I'm pretty sure the designer is loading the dll.
The same dll is containing a custom type converter.
I tried two approachs with no success:
- inherit from System.ComponenModel.TypeConverter
- implementing NHibernate.UserTypes.IUsertype && inherit from System.ComponenModel.TypeConverter
The type converter is not shown either on the element's field mapping nor on project's type conversion definitions.
Not even thinking on generate mappings or using it on my app.
By simplifying to the absurd step by step I finish wit:
public class MyConverter : TypeConverter
{
public new bool CanConvertFrom(Type sourceType) { return true; }
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return true; }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
return "Enum";
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
return "String";
}
public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
{
return string.Empty;
}
}
I also tried compiling explicitly for x86 and x64... nones.
I put the dll in a empty folder... nothing.
My environment is:
OS: Win 7 x64
LLBL: v.3.0 Final
Target DB: Oracle
Target Framework: NHiberante
DB Driver: Oracle ODP.NET
Much appreciated.