473,385 Members | 1,782 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.

C#( Is it possible to add the Enum in dynamically?)

Dev
Dear Friends,
Is it possible to add the Enum in dynamically.
Like Ex:
enum Colors
{
Green, Red,Yellow,Blue,Orange
}
So i want add 6th name Black to Colors.Is it possible? If so how?...If anyone knows please let me know....

Thanks,
Dev

Nov 13 '05 #1
2 14663
Dev,

No, it is not. There would be no way for other developers to know how
to use it as it would not be available at dev time, or at compile time.

What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Dev" <ra********@hotmail.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
Dear Friends,
Is it possible to add the Enum in
dynamically.
Like Ex:
enum Colors
{
Green, Red,Yellow,Blue,Orange
}
So i want add 6th name Black to Colors.Is it possible? If so how?...If
anyone knows please let me know....

Thanks,
Dev
Nov 13 '05 #2
You're looking to have runtime-configured data domains. To do that use
a custom data container class that wraps a Hashtable. Hashtables are
key-value type containers and the keys are unique so they lend
themselves nicely to this problem.
"Dev" <rajan sr**@hotmail.com> wrote in message news:<uA**************@TK2MSFTNGP11.phx.gbl>...
Dear Friends,
Is it possible to add the Enum in
dynamically.
Like Ex:
enum Colors
{
Green, Red,Yellow,Blue,Orange
}
So i want add 6th name Black to Colors.Is it possible? If so how?...If
anyone knows please let me know....

Thanks,
Dev

--

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Moe Green | last post by:
I want create a method which uses a dynamically enum as the type of one of its parameters. I can create the assembly with this code: AssemblyName myAssemblyName = new AssemblyName();...
2
by: mrhicks | last post by:
Hello all, I have a question about enumerations. Within some requirements data passed back a certain bit field is defined by three bits then in another section the bit field is defined as 4...
5
by: Ken Allen | last post by:
I have a need to convert the names of the members of an enumeration into an array of strings at runtime. I have determined a method using reflection. Type theType = typeof(MyEnumName);...
4
by: Popoxinhxan | last post by:
Hi guy, i just wondering that is it posible to convert the array of string to enum types dynamically, for example i get the list of countries name from database and would like to convert all of...
2
by: Chowdary Doppalapudi | last post by:
Hi All Is there any way to create the Enum dynamically from database table. Thank Chowdary D
4
by: Ryan Liu | last post by:
Can I create an enum dynamically in the code, e.g. data base driven? Thanks! Ryan
4
by: Pritcham | last post by:
Hi all I've got a number of classes already developed (basic entity classes) like the following: Public Class Contact Private _firstname as String Private _age as Integer Public Property...
4
by: Steve Teeples | last post by:
Given this definition of an enum: enum MyEnum { d1=1, d2=2 } Is there a way to dynamically create this same enum at runtime? I want to
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
0
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...
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.