C# 3.0 Method Extenders

“Method Extenders” is one of the most useful features introduced in the third version of .Net, which allows us to extend the features of a pre-built class. This small post will show you why you want them, how to use them, and the different versions of .Net you will need to deploy. Why you want extension...

Detecting if a piece of code is running in Design Time

Sometimes, you will want to distinguish if a certain piece of your code is being executed at run-time or as a part of the Visual Studio Design-Time calls. A very easy way of checking this is: bool isDesignTime = (this.Site != null && this.Site.DesignMode == true); Why to explain this? This is something quite obvious, but some people ask in the forums why they are receiving an exception...