473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Same Enum with different values depending of the project

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
3 1468
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Waqas Pitafi | last post by:
Hi, I have a table with the data like this, ID Status Description 1 R Read 2 U UnRead D D ...
3
by: Kenneth | last post by:
I want to define an enum for possible languages in my application. My enum look like this: Public Enum Languages English = 0 Portuguese = 1 End Enum How can i reuse this enum in the rest of...
12
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...
3
by: Richard | last post by:
Okay gang, This should be simple but apparently it's not... I want to use the System.DayOfWeek enum to create and access an array of objects with one object for each day of the week. I'd like...
1
by: Jim Hart | last post by:
Hi all! Can anyone explain this one to me. . . I have a 'Util' namespace with a 'Common' class that contains consts & values I use throughout multiple projects. One of the members of this...
13
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
3
by: K. Wilder | last post by:
I need to declare a project level Enum that any procedure in any class can reference so there's continuity with the values. How do I do this? At present, if I declare a Module in a project and...
5
by: thetrueaplus | last post by:
Hey all. I have bit shifted my enum values all the way to 31 items. I feel that this api that i am using continues to grow, i will be stuck with out any more items in my enum. I would like...
3
by: Ralfeus | last post by:
Hi all Oftenly I need to use enums but standard C# enums provide little bit poor possibilities. For example I'd like to restrict variables to get only values specified in enums. Also sometimes I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.