Click here to Skip to main content
11,430,053 members (72,983 online)
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

Passing Enum type as a parameter

, 24 Aug 2011 CPOL
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)

Share

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 | Terms of Use | Mobile
Web03 | 2.8.150428.2 | Last Updated 24 Aug 2011
Article Copyright 2011 by Daniel Gidman
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid