foreach enum

Code Example - foreach enum

                
                        foreach (MyEnum enumValue in (MyEnum[]) Enum.GetValues(typeof(MyEnum)))
{
}
                    
                
 

csharp foreach enum

                        
                                enum Foos {
  Foo,
  Bar,
}

foreach(Foos val in Enum.GetValues(typeof(Foos))) {
  //Do whatever with the value :D
}
                            
                        
 

enum foreach

                        
                                foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit)))
{
}