What's this C# "using" directive?

Ronnie Overby picture Ronnie Overby · Jun 23, 2009 · Viewed 9.9k times · Source

I saw this C# using statement in a code example:

using StringFormat=System.Drawing.StringFormat;

What's that all about?

Answer

Sean picture Sean · Jun 23, 2009

That's aliasing a typename to a shorter name. The same syntax can also be used for aliasing namespaces. See using directive.

(Updated in response to Richard)