By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,581 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,581 IT Pros & Developers. It's quick & easy.

Same Enum with different values depending of the project

P: n/a
Hi, is it possible to create a project that can offer
different members of a Public Enum according to a
condition ?

I mean, Project A has a public enum.
Project B & C access A's enum. However B should see some
elements of the enum while C should see others...

Is this achievable ??

Thanks a lot,
Alan.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
AFAIK, you cannot do that. Any particular reason you would want to do that?
Maybe there's some other way to achieve what you want to do. A little more
detail would certainly help.

Imran.

"Alan" <an*******@discussions.microsoft.com> wrote in message
news:0d****************************@phx.gbl...
Hi, is it possible to create a project that can offer
different members of a Public Enum according to a
condition ?

I mean, Project A has a public enum.
Project B & C access A's enum. However B should see some
elements of the enum while C should see others...

Is this achievable ??

Thanks a lot,
Alan.

Nov 21 '05 #2

P: n/a
"Imran Koradia" wrote:
AFAIK, you cannot do that. Any particular reason you would want to do that?
Maybe there's some other way to achieve what you want to do. A little more
detail would certainly help.

Imran.


Well, what i'm trying to accomplish is the following:

To have a custom control with an enum property where the enum property
coincides with a value on the database. The custom control will use the enum
value selected to retrieve child values from the database. So the control
cares not about the description of the enum, it just uses the number.

So the idea is to be able to provide this descriptions according to the
project i'm using this custom control from.

If i'm using the control from project A then the enum should be:

public enum myenum
enumval0 = 0
enumval1 = 1
enumval2 = 2
end enum

and if from project B:

public enum myenum
otherval0 = 0
otherval1 = 0
otherval2 = 0
end enum

This is just to be able to use the control from different projects and give
the developer the intellisense functionality provided by enums
Nov 21 '05 #3

P: n/a
I don't quite understand why you would want to do that. One thing is for
sure that you cannot assign different values to enums - they are effectively
constants that cannot be changed. The only thing I can think of is defining
multiple enums.

Imran.

"Alan" <Al**@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
"Imran Koradia" wrote:
AFAIK, you cannot do that. Any particular reason you would want to do that? Maybe there's some other way to achieve what you want to do. A little more detail would certainly help.

Imran.

Well, what i'm trying to accomplish is the following:

To have a custom control with an enum property where the enum property
coincides with a value on the database. The custom control will use the

enum value selected to retrieve child values from the database. So the control
cares not about the description of the enum, it just uses the number.

So the idea is to be able to provide this descriptions according to the
project i'm using this custom control from.

If i'm using the control from project A then the enum should be:

public enum myenum
enumval0 = 0
enumval1 = 1
enumval2 = 2
end enum

and if from project B:

public enum myenum
otherval0 = 0
otherval1 = 0
otherval2 = 0
end enum

This is just to be able to use the control from different projects and give the developer the intellisense functionality provided by enums

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.