Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# & CORBA Pin
Dan Neely16-Dec-05 4:59
Dan Neely16-Dec-05 4:59 
AnswerRe: C# & CORBA Pin
Nick Parker16-Dec-05 5:47
protectorNick Parker16-Dec-05 5:47 
QuestionFill comboBox with data from database Pin
Duif16-Dec-05 4:28
Duif16-Dec-05 4:28 
AnswerRe: Fill comboBox with data from database Pin
albCode16-Dec-05 4:43
albCode16-Dec-05 4:43 
GeneralRe: Fill comboBox with data from database Pin
Duif16-Dec-05 5:38
Duif16-Dec-05 5:38 
GeneralRe: Fill comboBox with data from database Pin
g00fyman16-Dec-05 15:36
g00fyman16-Dec-05 15:36 
GeneralRe: Fill comboBox with data from database Pin
albCode18-Dec-05 1:41
albCode18-Dec-05 1:41 
QuestionProblem setting values of an enum class derived from an xsd Pin
Dan Neely16-Dec-05 4:13
Dan Neely16-Dec-05 4:13 
I have a paremeter in an xml file that can contain one of a dozen discrete, non contigious integers. To enforce the limited selection I've defined them as follows in the xsd, and built a wrapper class using the xsd tool.

<code>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:enumeration value="123"/>
......
</xs:restriction>
</xs:simpleType>
</code>


<code>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="TheNameSpace")]
public enum EnumType
{
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("123")]
Item123,
}
</code>

I can read/write the xml normally without problem. The issue comes when I want to reassign a value of EnumType, and use it later in the session.

<code>
xmlClassObject.EnumTypeValue = (EnumType)123;</code>

This assigns the value to the enum, and will save properly. The problem is that as shown in the debugger or created using ToString(), the value loaded from the file is "Item123", while the value I set in code is "123". Is this a bug in MSes code, or should I be setting the value in a different method? I tried creating the string "Item123" and assigning that, but the cast failed.

-- modified at 10:13 Friday 16th December, 2005

Is there a way I can use the code tags, and still have my XML survive?
QuestionHow to Share Directory programmatically? Pin
manojk_batra16-Dec-05 3:58
manojk_batra16-Dec-05 3:58 
AnswerRe: How to Share Directory programmatically? Pin
Judah Gabriel Himango16-Dec-05 5:14
sponsorJudah Gabriel Himango16-Dec-05 5:14 
AnswerRe: How to Share Directory programmatically? Pin
Jared Parsons16-Dec-05 11:23
Jared Parsons16-Dec-05 11:23 
GeneralRe: How to Share Directory programmatically? Pin
manojk_batra16-Dec-05 22:44
manojk_batra16-Dec-05 22:44 
QuestionContextual Menu In Shared Web Folders Pin
rakesh_nits16-Dec-05 3:25
rakesh_nits16-Dec-05 3:25 
QuestionCodeTalk for Developers Pin
DeepToot16-Dec-05 3:24
DeepToot16-Dec-05 3:24 
Questionlaunching the default email client from a C# app Pin
cobra200516-Dec-05 3:18
cobra200516-Dec-05 3:18 
AnswerRe: launching the default email client from a C# app Pin
cobra200516-Dec-05 3:22
cobra200516-Dec-05 3:22 
AnswerRe: launching the default email client from a C# app Pin
Polis Pilavas16-Dec-05 5:57
Polis Pilavas16-Dec-05 5:57 
GeneralRe: launching the default email client from a C# app Pin
cobra200516-Dec-05 6:38
cobra200516-Dec-05 6:38 
GeneralRe: launching the default email client from a C# app Pin
TheGreatAndPowerfulOz16-Dec-05 7:18
TheGreatAndPowerfulOz16-Dec-05 7:18 
GeneralRe: launching the default email client from a C# app Pin
cobra200516-Dec-05 11:00
cobra200516-Dec-05 11:00 
GeneralRe: launching the default email client from a C# app Pin
TheGreatAndPowerfulOz16-Dec-05 11:09
TheGreatAndPowerfulOz16-Dec-05 11:09 
Questionbuild number of version Pin
Savas Cilve16-Dec-05 2:01
Savas Cilve16-Dec-05 2:01 
AnswerRe: build number of version Pin
Jared Parsons16-Dec-05 8:30
Jared Parsons16-Dec-05 8:30 
AnswerRe: build number of version Pin
leppie16-Dec-05 10:43
leppie16-Dec-05 10:43 
QuestionCrystall report and Com+ problem Pin
webhay16-Dec-05 1:15
webhay16-Dec-05 1:15 

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.