Is there a way to loop over the static variables of a struct?
public struct FunFoods
{
public static readonly Guid GRANOLA = new
System.Guid("00000000-0000-0000-0000-000000000101");
public static readonly Guid TRAILMIX = new
System.Guid("00000000-0000-0000-0000-000000000102");
public static readonly Guid PEANUTS = new
System.Guid("00000000-0000-0000-0000-000000000103");
}
As in....
List<GuidfunFoodList = new List<Guid>();
foreach ( static_variable svar in fun_foods_stucture ) // obviously
this doesn't work, just trying to get the concept across
{
funFoodList.Add(svar);
}
Something like that?