I justed posted up my Round 1 Iron Coder solution at Project Distributor. I wonder how Joseph is coming along with his, or even if he has checked his RSS feeds yet to know when the deadline is – although he has plenty of time to get it done.

For my solution I built an extender provider (duh) which adds a “Roles” property to each component on the design surface. I’ve done a really quick Camtasia screen recording to document the user experience.

Currently it will work with controls generically but tab pages in particular need some special attention. The reason is that although a TabPage ultimately derives from Control, there are somethings that you can do with a Control that you can’t do with a TabPage. For example if I set the Visible property on a TabPage to false it has no effect at all.

This is because the tab control actually renders the tabs, not the individual tab pages, and it doesn’t honour the visible property, so the only way to do it is remove the tab page from the collection of tab pages. Here is my lock-down code where you can see the customisation.

LockDownCode

One thing that the sub-classing camp does have going for it is that it has a nice logical place to put snippets of code like this – I just happen to think sub-classing is a high price to pay for it. Over time I think the extender provider approach will show its versatility when we throw a few more controls into the mix – in my case it takes little to no extra effort to do that.

In the long-run however neither sub-classing or extender providers are the way of the future – Avalon has a much more different object model and I wouldn’t be surprised if security and validation could be painted on as if it were a style.