User Tools

Site Tools


notes:csharp:enums

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notes:csharp:enums [2016/10/26]
admin
notes:csharp:enums [2017/02/08] (current)
admin [Iterating Enum Values]
Line 89: Line 89:
 <code csharp> <code csharp>
 // An item containing a description of an enum value. // An item containing a description of an enum value.
-class Item+public ​class Item
 { {
     public int Id { get; set; }     public int Id { get; set; }
Line 96: Line 96:
  
 // A method to obtain a collection of items. // A method to obtain a collection of items.
-private ​static List<​Item>​ GetEnumValues<​T>​() where T : struct+public ​static List<​Item>​ GetEnumValues<​T>​() where T : struct
 { {
     List<​Item>​ list = new List<​Item>​();​     List<​Item>​ list = new List<​Item>​();​
Line 110: Line 110:
  
 // An example usage. // An example usage.
-enum BasicColor+public ​enum BasicColor
 { {
     White,     White,
notes/csharp/enums.txt ยท Last modified: 2017/02/08 by admin