R
Ray Cassick \(Home\)
I have a function that takes a value is as System.Enum and I want to be able
to look at that value and determine if it is a regular enum or an enum that
has a <Flag()> attribute set on it.
I am trying to write a wrapper function that takes an enum and an integer
value and validates if the value is actually part of the enum. Just trying
to use .IsDefined will not return accurate results (as far as I can find) if
the enum is a flag so if it is I want to jump to some other code and try to
validate another way.
I have been looking all over and can't find a way (probably using
reflection) to inspect this and look for any applied attributes.
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/
to look at that value and determine if it is a regular enum or an enum that
has a <Flag()> attribute set on it.
I am trying to write a wrapper function that takes an enum and an integer
value and validates if the value is actually part of the enum. Just trying
to use .IsDefined will not return accurate results (as far as I can find) if
the enum is a flag so if it is I want to jump to some other code and try to
validate another way.
I have been looking all over and can't find a way (probably using
reflection) to inspect this and look for any applied attributes.
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/