In a C # / WPF application, I added the TypeConverter attribute for some of my enumerations to display localized text instead of enum text:
[TypeConverter(typeof(LocalizedEnumTypeConverter))] public enum MyEnum { EnumVal1 = 0, EnumVal2 = 1, EnumVal3 = 2, }
I performed LocalizedEnumTypeConverter to accomplish this task.
The problem occurs when I try to use the same enumeration approach that is defined in another assembly that does not have access to LocalizedEnumTypeConverter and is common to other applications (that is, I cannot add a reference to the assembly where LocalizedEnumTypeConverter is defined).
Is there a way to add a TypeConverter attribute at runtime? That way, I can leave the enumeration in another assembly without the TypeConverter attribute, and then add it at runtime in my application.
source share