Same Enum with different values depending of the project

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

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.
 
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.
 
Imran Koradia said:
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top