Type aliasing in using declarations
Whilst this is a good tip, I wouldn't go as far as qualifing an entire class as you have done. I would stop at the namespace level, so your example becomes:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Drawing;using Media =...
Whilst this is a good tip, I wouldn't go as far as qualifing an entire class as you have done. I would stop at the
namespace
level, so your example becomes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Media = System.Windows.Media;
namespace WindowsFormsApplication1
{
class With
{
public void Foo()
{
Color winformsColor = Color.AntiqueWhite;
Media.Colour wpfColor = new Media.Colour();
Console.WriteLine(winformsColor.ToString() + wpfColor.ToString());
}
}
}
I think this is more readable and less likely to confuse others who may go looking for a class definition that doesn't exist.