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. 4 11398
It's only a bug in Visual Studio, it should work after compiling your
class...
Rafael.
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com... 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.
Andrew <An****@discussions.microsoft.com> wrote: 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.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
you can not access a static from instance object.
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com... 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.
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.
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com... 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steven T. Hatton |
last post by:
Any opinions or comments on the following? I don't say it below, but I came
out on the side of using enumerations over static constants.
/* I'm trying to figure out the pros and cons of using...
|
by: Bill Cohagan |
last post by:
I've got an abstract class (say foo) and I'd like to define an Enum (say
bar) within that class so that I can then refer to foo.bar.<one of the enum
labels> from within other parts of the program....
|
by: Alex Feldman |
last post by:
Which of the following is better? Defining an enum type inside a class
as a nested type, or in the the namespace?
An example of nested type enumerated type would be:
public Class Product...
|
by: kc |
last post by:
I'm trying to pull data from a database that I have no control over the
structure of. There's a members table with a column for the member's
sex. It just stores the sex as M or F. I'd like to...
|
by: yancheng.cheok |
last post by:
hello all,
how can i make, a forward declaration class's enum member, being
visible by another class?
consider the following case,
----------------------------
dog.h...
| |
by: toton |
last post by:
Hi,
I have some enum (enumeration ) defined in some namespace, not inside
class. How to use the enum constant's in some other namespace without
using the whole namespace.
To say in little...
|
by: Phil Davidson |
last post by:
/*
(Posted to microsoft.public.dotnet.languages.vc)
In C++/CLI under Visual Studio 2005, creating an "enum class" member
called "Equals" can cause compiler error C1060 (out of memory) and C1063...
|
by: Cmtk Software |
last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI
managed c++ and from C#.
I defined the following enum in a VS dll project set to be compiled with the
/clr switch:
...
|
by: dev_15 |
last post by:
Hi, I have this problem that i want to use an enum as a return value
of a private method in my class, but compiler won't let me use as such
Code here:
class CDisplayUtil
{
public:
enum...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |