C#: can you add to an enum type in run-time

Posted by Craig Johnston on Stack Overflow See other posts from Stack Overflow or by Craig Johnston
Published on 2010-05-06T08:53:50Z Indexed on 2010/05/06 8:58 UTC
Read the original article Hit count: 222

Filed under:
|
|

If I have the enum type:

Public enum Sport
{
    Tennis = 0;
    Football = 1;
    Squash = 2;
    Volleyball = 3;
}

Can I somehow add during run-time:

PingPong = 4

© Stack Overflow or respective owner

Related posts about c#

Related posts about enums