What are the .NET Compact Framework Alternatives to Enum.Parse and
Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt 4 4874
Use OpenNETCF's SDF. It has the EnumEx class. www.opennetcf.org/sdf
-Chris
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:K8********************@comcast.com... What are the .NET Compact Framework Alternatives to Enum.Parse and Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt
Thanks,
What about the Enum.Format method? Is there an alternative way to perform
this task:
[Flags]
public enum TypesToCompare
{
none = 0
option1 = 1
option2 = 2
option3 = 4
option4 = 8
}
-----snip------
string enums;
enumTypeToCompare = TypesToCompare.option4 + TypesToCompare.option2
enums = Enum.Format(enumTypeToCompare, TypesToCompare, "f");
the resulting string would yeild:
"4, 2"
Thanks,
Matt
"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl... Use OpenNETCF's SDF. It has the EnumEx class.
www.opennetcf.org/sdf
-Chris "ME" <tr*********@comcast.netREMOVETHIS> wrote in message news:K8********************@comcast.com... What are the .NET Compact Framework Alternatives to Enum.Parse and Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt
Sorry, my bad the resulting string would yeild "8, 2"
Thanks,
Matt
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:WM********************@comcast.com... Thanks,
What about the Enum.Format method? Is there an alternative way to perform this task: [Flags] public enum TypesToCompare { none = 0 option1 = 1 option2 = 2 option3 = 4 option4 = 8 } -----snip------ string enums; enumTypeToCompare = TypesToCompare.option4 + TypesToCompare.option2
enums = Enum.Format(enumTypeToCompare, TypesToCompare, "f");
the resulting string would yeild:
"4, 2"
Thanks, Matt
"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message news:%2******************@TK2MSFTNGP15.phx.gbl... Use OpenNETCF's SDF. It has the EnumEx class.
www.opennetcf.org/sdf
-Chris "ME" <tr*********@comcast.netREMOVETHIS> wrote in message news:K8********************@comcast.com... What are the .NET Compact Framework Alternatives to Enum.Parse and Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt
I'll make a note of a feature request for Format(). One slightly messy way
to do this right now would be to do a tostring which should give you
"option4, option2" then split this and do a Parse on each member, get the
integer value, the reassemble back into a string.
Peter
--
Peter Foot
Windows Embedded MVP http://www.inthehand.com | http://www.peterfoot.net | http://www.opennetcf.org
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:ZL********************@comcast.com... Sorry, my bad the resulting string would yeild "8, 2"
Thanks,
Matt "ME" <tr*********@comcast.netREMOVETHIS> wrote in message news:WM********************@comcast.com... Thanks,
What about the Enum.Format method? Is there an alternative way to perform this task: [Flags] public enum TypesToCompare { none = 0 option1 = 1 option2 = 2 option3 = 4 option4 = 8 } -----snip------ string enums; enumTypeToCompare = TypesToCompare.option4 + TypesToCompare.option2
enums = Enum.Format(enumTypeToCompare, TypesToCompare, "f");
the resulting string would yeild:
"4, 2"
Thanks, Matt
"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message news:%2******************@TK2MSFTNGP15.phx.gbl... Use OpenNETCF's SDF. It has the EnumEx class.
www.opennetcf.org/sdf
-Chris "ME" <tr*********@comcast.netREMOVETHIS> wrote in message news:K8********************@comcast.com... What are the .NET Compact Framework Alternatives to Enum.Parse and Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: ME |
last post by:
What are the .NET Compact Framework Alternatives to Enum.Parse and
Enum.Format as they are not supported by the Compact Framework?
Thanks,
Matt
|
by: Andreas Huber |
last post by:
Hi there
Spending half an hour searching through the archive I haven't found a
rationale for the following behavior.
using System;
// note the missing Flags attribute
enum Color
{
|
by: Anonieko Ramos |
last post by:
Answer:
http://weblogs.asp.net/tims/archive/2004/04/02/106310.aspx
by Tim Sneath
I've come across the situation on a number of occasions when coding
where I've wanted to convert from a string...
|
by: cadilhac |
last post by:
Hi,
I have the following code:
public enum MyColors { Red, Green, Blue }
MyColors c = (MyColors)Enum.Parse(typeof(MyColors), "abcd");
Why do I get c = "abcd" after this code instead of...
|
by: giant food |
last post by:
This seems like a long shot, but I wondered if there's a way to loop
over the values in an Enum. For example, say I have an Enum as
follows:
Public Enum statusValues
Ready
Running
Finished...
|
by: John A Grandy |
last post by:
how to iterate through the members of an Enum ?
Enum EnumAction
None = 0
Action1 = 1
Action2 = 2
Action3 = 3
Action4 = 4
End Enum
|
by: kc |
last post by:
I'm trying to pull data from a database that I have no control over the
structure of. There's a members table with a column for the member's
sex. It just stores the sex as M or F. I'd like to...
|
by: Steven Nagy |
last post by:
So I was needing some extra power from my enums and implemented the
typesafe enum pattern.
And it got me to thinking... why should I EVER use standard enums?
There's now a nice little code...
|
by: kjqua |
last post by:
Hi all,
I am newbie in c# and i have a question.
I try to work with serial port.
and i will like to configure the serial port by a form
I add in a ComboBox.parity some items like:
None
Odd
|
by: Doug |
last post by:
I have an enum that will look kind of like this:
private enum MyEnum
{
SomeValue = 0,
AnotherValue = 1,
ThirdValue = 2
}
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |