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

Friday, December 22, 2006

OutSmart the SmartPart

My 5 cents on how-to-use SmartPart in Microsoft Office SharePoint 2007

1. After installation of SmartPart and creation of the 'UserControls'-folder in your SharePoint-site, you can deploy
a. Self-contained .ascx-file's (read markup + code) in the UserControls-folder.
b. Codebehind-modeled usercontrols (read separate .ascx + .cs); drop both files in this folder.
c. Updatable+compiled-modeled usercontrols (read: .ascx with markup + compiled .dll); put the .ascx-file in the UserControls-folder and the .dll-file in the 'bin'-folder of your site.

2. Place a System.ComponentModel.DescriptionAttribute on you class with a 'user-friendly' description.

3. Custom properties for your UserControl(-derived) class have to be attributed with System.ComponentModel.[BrowsableAttribute(true)] (and an optional [DescriptionAttribute("...")]) if u want them to appear in the MOSS-WebPart-propertygrid.

//TODO: Connections

Friday, December 08, 2006

A Blogging Tip

Thou Shall Not Steal Bandwidth

Microsoft learned it the hard way

Niall Kennedy took some pics from last year's Gnomedex and hosted them on Flickr under Creative Commons. Microsoft's RSS blog linked directly to one of his pics without source and Niall replaced it with a modified Goatse image!

WARNING: Explicit content!  Screenshot; no Goatse for me ;-)

An apology followed: 'Apologies to readers who downloaded an earlier version of this post, which used a photograph taken by Niall Kennedy and posted on He did not appreciate the usage, and replaced it with a different image. I forgot to include an attribution, which I had fully intended to do, but for which I apologise to him'