Click here to Skip to main content
15,879,095 members
Home / Discussions / C#
   

C#

 
QuestionHow to save exported data into any location with desire file name Pin
Aayush Singh17-Apr-06 5:51
Aayush Singh17-Apr-06 5:51 
AnswerRe: How to save exported data into any location with desire file name Pin
Ravi Bhavnani17-Apr-06 6:22
professionalRavi Bhavnani17-Apr-06 6:22 
QuestionFilter DataSet in Windows Form Pin
jrprogrmr17-Apr-06 4:02
jrprogrmr17-Apr-06 4:02 
AnswerRe: Filter DataSet in Windows Form Pin
Braulio Dez17-Apr-06 7:20
Braulio Dez17-Apr-06 7:20 
Questionpassing an array of floats from C++ dll to C# Pin
Denis Shamanin17-Apr-06 3:59
Denis Shamanin17-Apr-06 3:59 
AnswerRe: passing an array of floats from C++ dll to C# Pin
Andy Moore17-Apr-06 4:06
Andy Moore17-Apr-06 4:06 
GeneralRe: passing an array of floats from C++ dll to C# Pin
Denis Shamanin17-Apr-06 4:15
Denis Shamanin17-Apr-06 4:15 
QuestionProblem with enum created from xsd Pin
Dan Neely17-Apr-06 3:45
Dan Neely17-Apr-06 3:45 
I've got a numerical value that can have only a small number of legal, non contigious values that's stored in an XML file.

The value's defined in the XSD like this:
<code><xs:element name="Number">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:enumeration value="100"/>
<xs:enumeration value="179"/>
<xs:enumeration value="654"/>
</xs:restriction>
</xs:simpleType>
</xs:element></code>

and an entry in the XML looks like:
<code><Number>179</Number></code>

The class created by the XSD tool is:
<code>public enum Number
{
[System.Xml.Serialization.XmlEnumAttribute("100")]
Item100,
[System.Xml.Serialization.XmlEnumAttribute("179")]
Item179,
[System.Xml.Serialization.XmlEnumAttribute("654")]
Item654,
}</code>

When I use the debugger to view the value of a Number that was loaded from an XML file it looks like "Item100". The problem is that if I want to assign it a new value stored in an integer by doing:
<code>numberValue = (Number)100;</code>

numberValue is assigned "100", this will be correctly written if the XML is serialized, but having two different representations for the same value is causing problems elsewhere in my backend. I can't cast the string "Item100" a Number object, and would like to avoid a two dozen item if/else statement of this form:
<code>if (s == "Item100")
num = Number.Item100;</code>
AnswerRe: Problem with enum created from xsd Pin
Guffa17-Apr-06 4:46
Guffa17-Apr-06 4:46 
GeneralRe: Problem with enum created from xsd Pin
Dan Neely17-Apr-06 5:36
Dan Neely17-Apr-06 5:36 
QuestionExample On InternetGetConnectedStateEx Pin
visalak17-Apr-06 2:29
visalak17-Apr-06 2:29 
QuestionHow to carry out MoneyCell with the VS2005 and GDI+? Pin
Chinese_ynzy17-Apr-06 0:22
Chinese_ynzy17-Apr-06 0:22 
QuestionHow to add set Index for Label in C#? Pin
tosen_z16-Apr-06 23:53
tosen_z16-Apr-06 23:53 
AnswerRe: How to add set Index for Label in C#? Pin
alexey N17-Apr-06 0:58
alexey N17-Apr-06 0:58 
GeneralRe: How to add set Index for Label in C#? Pin
HimaBindu Vejella17-Apr-06 18:24
HimaBindu Vejella17-Apr-06 18:24 
GeneralRe: How to add set Index for Label in C#? Pin
alexey N17-Apr-06 20:02
alexey N17-Apr-06 20:02 
GeneralRe: How to add set Index for Label in C#? Pin
HimaBindu Vejella17-Apr-06 20:05
HimaBindu Vejella17-Apr-06 20:05 
GeneralRe: How to add set Index for Label in C#? Pin
tosen_z18-Apr-06 22:28
tosen_z18-Apr-06 22:28 
GeneralRe: How to add set Index for Label in C#? Pin
alexey N18-Apr-06 23:36
alexey N18-Apr-06 23:36 
GeneralRe: How to add set Index for Label in C#? Pin
tosen_z19-Apr-06 17:53
tosen_z19-Apr-06 17:53 
QuestionDrawing one pixel wide dashed lines in gdi+ Pin
Specia314716-Apr-06 23:15
Specia314716-Apr-06 23:15 
QuestionHow to load image with Jpeg compression in .net 2003 Pin
Rizwan Bashir16-Apr-06 23:14
Rizwan Bashir16-Apr-06 23:14 
AnswerRe: How to load image with Jpeg compression in .net 2003 Pin
Guffa16-Apr-06 23:19
Guffa16-Apr-06 23:19 
GeneralRe: How to load image with Jpeg compression in .net 2003 Pin
Rizwan Bashir17-Apr-06 0:10
Rizwan Bashir17-Apr-06 0:10 
AnswerRe: How to load image with Jpeg compression in .net 2003 Pin
Guffa17-Apr-06 1:11
Guffa17-Apr-06 1:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.