Complex Type Custom Properties and Sharepoint .dwp file
.DWP files lets you add default values for a Webpart - this is really cool - this way you could ship multiple instance of same webpart just by changing the default values..
The things get messy when your custom propperties gets compleX. I was trying to put default value for a custome property of "Enum" type - tried following things - which didn't work
Enum Games
{
BasketBall,
BaseBall,
Rugby
}
<game xmlns="http://mynamespace">1</game>
<game xmlns="http://mynamespace" >Games.Rugby</game>
Finallly this worked
<game xmlns="http://mynamespace">Rugby</game>
Looks like "Rugby" is a string type but internally Sharepoint engine map this to Games.Enum
The most annoying part of this exersise was that SharePoint engine gives very cryptic error when you try ot drop webpart on a page. All it say is "One of your custom Properties could not be deserialize"
Wish MS could provide better technique to catch such error or alteast a callstack of code which throws this error
