Thursday, December 28, 2006

Not that Smart

After struggling way too long to create properties of type System.Int32 for the SmartPart, I decided to reflector 'ReturnOfSmartPart.dll'.

For some reason the values of my Int32 properties aren't persisted (yes, they are public, get + set, with System.ComponentModel.[BrowsableAttribute(true)] and even a [DescriptionAttribute("...")].


Reflector saved the/my day (again) (see image)

Somewhere in the 'ApplyChanges'-method of class 'UserControlPropertiesToolpart' there's a 'typo' (programmers don't like to use the word 'bug'):

if (text2 == "System.Int")

This should be

if (text2 == "System.Int32")

As int is 'syntactic sugar' for the real .NET System.Int32 type.
So, I used a System.String instead and 'lived happily ever after' ...



Reflector screenshot

No comments: