enums in C# - assignment

Posted by Zka on Stack Overflow See other posts from Stack Overflow or by Zka
Published on 2010-03-18T19:08:53Z Indexed on 2010/03/18 19:11 UTC
Read the original article Hit count: 389

Filed under:
|

How does one do this in c#?

Let's say that myclass has :

private enum Days{};


1) How does one add data to the enum inside the myclass with the help of the constructor? As in :

myclass my = new myclass(Monday,Friday);

so that the enum inside the class gets the "Monday, Friday" properties.


2) Can one also make a property for an enume inside the class once it is initialized ? For example :

my.Days = new enum Days(Tuesday); //where the old settings are replaced.

© Stack Overflow or respective owner

Related posts about c#

Related posts about enums