Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Passing Enum type as a parameter

, 24 Aug 2011
Rate this:
Please Sign up or sign in to vote.
I think the compile time force for a little enum enforcement would look something like this... (excuse the bad syntax, doing it from memory)private T GetPreviousEnum(this T currentlySelectedEnum) where T: structStackOverflow has a good question and answer in relation to it here.[^].

I think the compile time force for a little enum enforcement would look something like this... (excuse the bad syntax, doing it from memory)

private T GetPreviousEnum<T>(this T currentlySelectedEnum) where T: struct

StackOverflow has a good question and answer in relation to it here.[^].

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Daniel Gidman
Architect Stackify
United States United States
No Biography provided
Follow on   Twitter   Google+

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 24 Aug 2011
Article Copyright 2011 by Daniel Gidman
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid