Archive for 2011

First some background.
Unless you are new to .NET development you will have heard of and probably used the excellent .NET Reflector tool that was written some years ago by Lutz Roeder. It takes a .NET assembly and does a good job of decompiling it into C#. It has many more features than just this but that is the core functionality. I have used it many times to help me understand how the base classes work in WinForms. In August 2008 Lutz sold .NET Reflector to Red Gate Software who continued to provide a free version but they also developed extra features that became commercial versions.

Show Me The Money

On Feb 2nd 2011 they announced that they would be charging $35 for the tool. When a product has been available for many years for free the market expects it to remain free. Especially when Lutz sold it to Red Gate and the impression people received at the time was that a version of  it would remain forever free.

This has created some backlash from developers, not all developers, but a vocal minority who feel they have been bait and switched. More importantly it created a hole in the market at the free price point. Two commercial companies have jumped into that space with JustDecompile from Telerik and dotPeek from JetBrains. Both of these are free. There is also an open source project called ILSpy that is making progress in replicating .NET Reflector functionality.

Back Flip
In response Red Gate have backtracked slightly with the following announcement. Basically it says that existing users of .NET Reflector can continue using version 6.8 for free into the future but all new customers will still need to pay. You can see the pricing for new customers here. This whole flip flop has really damaged the reputation of Red Gate.

It has also opened up a free for all where alternative tools will be developed when previously no one considered it worthwhile. I wonder if in a couple of years this will all be forgotten or will Red Gate look back and rue the decisions they made?

Another maintenance release containing fixes for the Krypton Toolkit and Krypton Ribbon.

The biggest change is the inclusion of help for Visual Studio 2010 SP1. Note that you do need the SP1 for Visual Studio 2010 in order to see the help. If you have not already installed it then you should do so before upgrading Krypton.

Font measuring has been fixed for the Input/Message/Task dialog boxes. The Validating and Validated events are now fired for the input controls. There are four new label styles that speed up development as well as numerous crash fixes. Check out the Toolkit and Ribbon change list documents using the links below to see a full list of changes.

Download 4.3.2

Toolkit Change List
Ribbon Change List

A good suggestion turned up on the forums the other day. Why not add Bold and Italic label styles to complement the existing Normal (Control) and Normal (Panel) styles. Given that many applications need to make these small visual changes it seemed like a good idea and easy to add. So here you are…

Bold and Italic Labels

I ‘ve had a couple of bug reports for the incorrect drawing of Krypton controls when there is a deep nesting of controls under Windows 7 64bit. You can see what I mean in the following image that shows a test application that has 8 KryptonNavigator instances all inside each other.

Incorrect drawing

I spent a couple of different attempts investigating this with no luck. No matter what I did and how I looked at the scenario the Krypton code did not seem to be doing anything wrong. Fortunately someone spotted a Microsoft Knowledge Base article describing this issue and presenting a workaround. You can read it here.

The solution to the above problem was to add the following new control and then replace the 4th instance of the KryptonNavigator with the new KryptonNavigatorDelay class.

 public class KryptonNavigatorDelay : KryptonNavigator
 {
   protected override void OnSizeChanged(EventArgs e)
   {
     if (Handle != null)
       BeginInvoke((MethodInvoker)delegate
          { base.OnSizeChanged(e); });
   }
 }

This results in the following appearance when resizing the window at runtime.

Correct drawing

The issue is with the operating system and seems to manifest itself under Windows 7 64bit when you have a depth of around 16 deep. Testing with various different controlsdoes not seem to make much difference in the depth required to see problems. Apparently the same problem can occur under 32bit operating systems but not until you have a much deeper level of nesting. Hence you are only likely to have encountered this problem under 64bit.

I cannot simply at the above code to every Krypton container because the solution causes a delay when drawing the control as the BeginInvoke delays execution of the delegate until the current windows message has been completed. So if you experience the issue then you need to check your nesting depth and look at implementing the work around at an appropriate level in the control hierarchy.

I recently purchased the latest version of HelpStudio from Innovasys so that I could compile the Krypton help into the new format used by Visual Studio 2010. After a few teething problems it is now working as you can see below…

Microsoft Help Viewer


Visual Studio 2010 SP1

Note however that you need to have SP1 for Visual Studio 2010 as the SP1 includes an update to the Microsoft Helper Viewer that includes a standalone browser as shown above. This should not be a major issue as developers should be using the latest version anyway.

Installer Size
Another downside is that the installer has ballooned because it includes the extra help so now it is ~116MB instead of the ~67MB before. Given that a large chunk of the older size was the help build used for Visual Studio 2005/2008 and you can see that something like 90% of the total installer size is actually just help.

HelpStudio Tips
For those that are also using the HelpStudio product I can pass along a couple of tips. The output from the HelpStudio build is a .mshc file that contains all the help pages.

What is not obvious is that the .mshc file will not work directly if you want to perform a silent install. We don’t want to require the user to start the help manager and start browsing for the .mshc file so it can be installed into the help system. So instead we want to run a silent install at the end of the Krypton installer.

So you need to take the .mshc file and turn it into a cab file by using the makecab utility. Then you need to sign the cab file using the signtool utility. Pass this signed cab into the silent install and then your good to go.

Another gotcha is the Microsoft Help Viewer will not add a top level node for your help collection, which is what the older help system did, and so your table of contents in HelpStudio should have a single top level node and then everything else appears as a child of that.