I'm using C# in VS2005. I have a class library that contains several enums common to a number of different projects. When accessing one of these enums I have to specify the whole namespace path to the enum even though I have declared a 'using' directive to the namespace that contains the enum.
For example I have the following enum:
namespace Company.General.Project1
{
public static class Rainbow
{
[Flags]
public enum Colours
{
Red,
Blue,
Orange
}
}
}
Then in another project I have:
using Company.General.Project1;
namespace Company.SpecialProject.Processing
{
public class MixingPallette
{
int myValue = Company.General.Project1.Colours.Red;
}
}
Even though I have the 'Using' directive referencing the project that contains the class of the enum, I still have to write the enum longhand. Why can't I do the following...
using Company.General.Project1;
namespace Company.SpecialProject.Processing
{
public class MixingPallette
{
int myValue = Colours.Red;
}
}