Having source code... or Anakrino

Fabrice writes:

I was not panicked as luckily MS had released the source code of the IE Web Controls not long before. After some investigation in the existing code, I found a way to create a custom TreeView control that would allow the client behavior to be deactivated. My TreeView is just an extension of the base TreeView with an added BehaviorUsage property which values can be Default, Deactivated or Forced. The source code is available for your curiosity or use.

This case is just an other example of the advantages of releasing source code...

I have done something similar on a few occasions, as luckily many (dare I say most) classes in the BCL are not sealed.

And yes, this is an advantage of releasing the source, as it makes things a lot easier to delve into. Most classes, of course, are not open-source, and I don't think this is anything we should expect any time soon.

If you haven't already, though, I would recommend checking out Anakrino, an awesome open-source C# decompiler. It can be very useful to get insight into a .NET assembly, either to extend / specialize functionality or to debug weird issues. And sure, the source code generated isn't quite as good as the original - for example, MSIL doesn't keep local variable names, so you lose those - but it still does the trick.

I know for me it has proved useful on more than a few occasions.

EngineeringWriting