Welcome to Geekdojo Sign in | Join | Help

using Aliased.Namespace = Namespace.Dont.Want.To.Use.Or.Cant.Use;

I had read the using directive usage for aliasing namespace in Eric Gunnerson's book when I started learning the C# syntax. Yesterday, I had to use it to avoid class name collision (I had two classes named Helper in two different namespaces and I needed both in the same place, so much for my API designing skills). Both the namespaces were a little long and I didn't want to type either of it again and again, so using namespace aliasing was the natural alternative.

It solved the problem very very neatly, and I just love the syntax, its so easy to remember, we assign the right namespace to the left one, really simple (great work C# design team: Hejlsberg et al.).

More information about it the .NET SDK documentation.

Published Saturday, November 29, 2003 7:37 PM by richardhsu
Filed Under:

Comments

Anonymous comments are disabled