In my WinForms app I'm loading a value from an XML file and converting it to
an Enum type I have called "ProductID". Here's the line of code I've used to
accomplish that:

SysInfo.Data.Admin.ProductID = (DataObjects.Constants.ProductID)
Enum.Parse(typeof(DataObjects.Constants.ProductID),
table.Rows[0]["ProductID"].ToString(), true);


One of the key things here is the use of 'Enum.Parse'. I'm now tryng to do
something similar in my Pocket PC app but I discovered that Enum.Parse does
not exist in the Compact Framework. So I'm wondering how I could accomplish
this. In essence, I'm trying to convert a string to an Enum type.

--
Robert W.
Vancouver, BC
www.mwtech.com

Re: Mobile Equivalent of Enum.Parse? by Alex

Alex
Tue Nov 01 00:25:36 CST 2005

Robert W. wrote:
> In my WinForms app I'm loading a value from an XML file and converting it to
> an Enum type I have called "ProductID". Here's the line of code I've used to
> accomplish that:
>
> SysInfo.Data.Admin.ProductID = (DataObjects.Constants.ProductID)
> Enum.Parse(typeof(DataObjects.Constants.ProductID),
> table.Rows[0]["ProductID"].ToString(), true);
>
>
> One of the key things here is the use of 'Enum.Parse'. I'm now tryng to do
> something similar in my Pocket PC app but I discovered that Enum.Parse does
> not exist in the Compact Framework. So I'm wondering how I could accomplish
> this. In essence, I'm trying to convert a string to an Enum type.
>
See EnumEx.Parse in OpenNETCF SDF

Re: Mobile Equivalent of Enum.Parse? by RobertW

RobertW
Tue Nov 01 00:48:01 CST 2005

Thanks, Alex!


--
Robert W.
Vancouver, BC
www.mwtech.com



"Alex Feinman (MVP)" wrote:

> Robert W. wrote:
> > In my WinForms app I'm loading a value from an XML file and converting it to
> > an Enum type I have called "ProductID". Here's the line of code I've used to
> > accomplish that:
> >
> > SysInfo.Data.Admin.ProductID = (DataObjects.Constants.ProductID)
> > Enum.Parse(typeof(DataObjects.Constants.ProductID),
> > table.Rows[0]["ProductID"].ToString(), true);
> >
> >
> > One of the key things here is the use of 'Enum.Parse'. I'm now tryng to do
> > something similar in my Pocket PC app but I discovered that Enum.Parse does
> > not exist in the Compact Framework. So I'm wondering how I could accomplish
> > this. In essence, I'm trying to convert a string to an Enum type.
> >
> See EnumEx.Parse in OpenNETCF SDF
>