How to make enum class member visible?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, friends,

I have an enum type class member like the follows, which will be shared by
all other classes,

public class FileFlags
{
.......
public static enum FileItem
{
Name = 0,
ItemType,
VersionNumber,
DateTime,
}
}

However, I could not see it from other class, i.e., after the declaration,

FileFlags myFileFlags = new FileFlags();

in myFileFlags online drop-down property/method window, I could not find
FileItem.

It could be easy, but please help....

Thanks.
 
It's only a bug in Visual Studio, it should work after compiling your
class...

Rafael.
 
Andrew said:
I have an enum type class member like the follows, which will be shared by
all other classes,

public class FileFlags
{
.......
public static enum FileItem
{
Name = 0,
ItemType,
VersionNumber,
DateTime,
}
}

Please post some actual code which will compile. Enums can't be
declared static, and if that bit is different from your actual code,
other things could be too.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Sorry, my mistake...
I didn't read the static word.

You can declare the enum outside the class as public, this maybe is a very
simple solution.

Good Luck.
 
Back
Top