Under the category of "you learn something new every day": While watching dnrTV this morning, I saw something that I've never seen done in C# before.

I knew that it was possible to make an "alias" for a namespace in C#. For example, if you have a complex namespace like MadProps.Windows.Controls (a contrived example) that you don't want to add to your "using" list, but you don't want to have to retype every time, you can use code like this to "alias" it:

using MPControls = MadProps.Windows.Controls;

That means that instead of typing "MadProps.Windows.Controls.TextBox" all through your code, you can just type "MPControls.TextBox". Nice.

What I learned this morning, however, is that you can do the same thing with types! If you have a type name that's really complex (think generic types) you can create an alias for them, too!

using MyDict = System.Collections.Generic.Dictionary<int, MyLongClassName>;

Now I can just declare a variable as type "MyDict" in code instead of retyping the full dictionary definition!

Granted the uses are limited. Unless it's a particularly nasty type name I think your code readability would be best served by avoiding these sorts of aliases. However, it's great to know that the feature exists.