Trying to achieve complete design-time integration on some controls I have a hard time figuring out how UITypeEditor works together with TypeConverter. I have made a very simple attempt, but not even that will work... On some Component I have put this property...
Code:
[EditorAttribute(typeof(MyUITypeEditor), typeof(UITypeEditor))]
[TypeConverterAttribute(typeof(MyTypeConverter))]
public int Something
{
get { return something; }
set { something = value; }
}
private int something = 0;
... where both MyUITypeEditor and MyTypeConverter are my own implementations. I assumed that the value returned from EditValue of the UITypeEditor implementation would go through the TypeConverter before getting assigned to the property, but that is not what I am seeing.
How is it supposed to work?
The thing is that the UITypeEditor will return a string in this test implementation and then I need MyTypeConverter to convert it into an integer. Very simple I thought! Please help if you know the answers.
When I try to debug while designing I can in fact see that the converter is called but I still an error message when returning from the EditValue method because of the wrong type, so what I am asking is if the TypeConverter is used on the returned value from EditValue?
Ups... I might add that it is rather a
Visual Studio 2005 problem than a C# problem, and it should probably be in another corner of this forum, sorry.
Thanks a lot, Jacob.