Get all stats for an enum : System.Enum : Data Type C# Examples


C# Examples » Data Type » System.Enum »

 

Get all stats for an enum









    
using  System;

enum  EmployeeType  :  byte  
{
    Manager  =  10,
    Programmer  =  1,
    Contractor  =  100,
    Developer  =  9
}

class  MainClass
{
    public  static  void  Main(string[]  args)
    {
        Array  obj  =  Enum.GetValues(typeof(EmployeeType));
        Console.WriteLine("This  enum  has  {0}  members:",  obj.Length);
    }
}
    
   
  
   



Output

This enum has 4 members:


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» System.Enum