OK, you confused me by bring up GetName. What you really wanted to do was:
PropertyBag["CurSysCheckNameList"]=
CurrentJobInformation.SystemIncludes.ToString().Split(new char[]
{' ', ','},
StringSplitOptions.RemoveEmptyEntries);
Given:
SystemChecks sc = CurrentJobInformation.SystemIncludes;
sc.ToString() will give you a string in the form "Fire, Flood".
We want to split that into an array of two strings, so you would think a simple
sc.ToString().Split(' ', ','); would do the trick, but the names are
separated by a comma and a space, which means the split will give you
three elements, the second one being empty -- which actually isn't
really a problem, but we like doing it right.
sc.ToString().Split(new char[] { ',', ' ' },
StringSplitOptions.RemoveEmptyEntries);
will give you an string array of just the names of the flags appearing
in SystemIncludes. (Inside the curly braces is
quote-comma-quote-comma-quote-space-quote, i.e., a comma character
literal and a space character literal)
On Fri, Aug 14, 2009 at 3:51 PM, JakeS<[email protected]> wrote:
>
> Thanks for the reply, but you can't use Enum.GetNames to fetch the
> actual data from an Enum instance. So rather than hack all around it,
> I changed the datatype from an enum to something easier to work with.
--
Truth,
James
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---