Skip to content

Instantly share code, notes, and snippets.

@morbidcamel101
Created February 27, 2015 20:38
Show Gist options
  • Select an option

  • Save morbidcamel101/b44b465c9222f8868cc6 to your computer and use it in GitHub Desktop.

Select an option

Save morbidcamel101/b44b465c9222f8868cc6 to your computer and use it in GitHub Desktop.
Example of how to loop an Enum
for (int index = 0; Enum.IsDefined(typeof(InteractionTypeEnum), index); index++) // Nice!
yield return new TaskItemType((InteractionTypeEnum)Enum.Parse(typeof(InteractionTypeEnum), index.ToString(CultureInfo.InvariantCulture)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment