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

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.