473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Set Value Of XmlElementAttribute That Is An Enum Contstant C#

233 100+
I have generated CS class from an Xml schema using xsd.exe. One class contains an enum, ItemsChoiceType1, that containts XmlElementAttribute values, DUNS, DUNSPlus4, GLN, AlternativeIdentifier. I think that I need to set the value for the constants, but I cannot figure out how to do so.

Expand|Select|Wrap|Line Numbers
  1. [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
  2.     [System.SerializableAttribute()]
  3.     [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:rosettanet:specification:universal:PartnerIdentification:xsd:schema:01.06", IncludeInSchema = false)]
  4.     public enum ItemsChoiceType1
  5.     {
  6.  
  7.         /// <remarks/>
  8.         [System.Xml.Serialization.XmlEnumAttribute("urn:rosettanet:specification:universal:DataType:xsd:schema:01.03:DUNS")]
  9.         DUNS,
  10.  
  11.         /// <remarks/>
  12.         [System.Xml.Serialization.XmlEnumAttribute("urn:rosettanet:specification:universal:DataType:xsd:schema:01.03:DUNSPlus4")]
  13.         DUNSPlus4,
  14.  
  15.         /// <remarks/>
  16.         [System.Xml.Serialization.XmlEnumAttribute("urn:rosettanet:specification:universal:DataType:xsd:schema:01.03:GLN")]
  17.         GLN,
  18.  
  19.         /// <remarks/>
  20.         [System.Xml.Serialization.XmlEnumAttribute("urn:rosettanet:specification:universal:Locations:xsd:schema:01.03:AlternativeIden" +
  21.             "tifier")]
  22.         AlternativeIdentifier,
  23.     } 
Expand|Select|Wrap|Line Numbers
  1. Items = new object[]
  2.                                     {
  3.                                         new ItemsChoiceType1()
  4.                                         {
  5.                                             //DUNS
  6.                                             //DUNSPlus4
  7.                                             //GLN
  8.                                             //AlternativeIdentifier
  9.                                         },                                        
  10.                                     },
Mar 10 '11 #1
1 2811
mcfly1204
233 100+
Expand|Select|Wrap|Line Numbers
  1. PartnerIdentification = new PartnerIdentificationType()
  2.                                 {
  3.                                     PartnerName = results[2],
  4.                                     Items = new object[]
  5.                                     {
  6.                                         distDUNS,
  7.                                     },
  8.                                     ItemsElementName = new ItemsChoiceType1[]
  9.                                     {
  10.                                         ItemsChoiceType1.DUNS,
  11.                                     }
  12.                                 },
This thread should probably be deleted.
Mar 10 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Imran | last post by:
Hello All I have a enum decla like this enum Days // Declare enum type Days { saturday, // saturday = 0 by default sunday = 0, // sunday = 0 as well monday, ...
16
by: Simon | last post by:
Hi all, I think I've seen someone passing an emumeration in code before. Can anyone tell me if thats possible and why i would want to. Many thanks Kindest Regards
18
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! I have created an enum list like this: enum myEnum : int { This = 2, That, NewVal = 10, LastItm
0
by: Toska | last post by:
Hi, Wonder how I can convert a string value to enum value. Code ------------------- <appSettings> <add key="BaseType" value="Sand" /> </appSettings>
4
by: veerleverbr | last post by:
Suppose having define an enum like this: public enum SomeEnum { Something, SomethingElse }
7
by: Harris | last post by:
Dear all, I have the following codes: ====== public enum Enum_Value { Value0 = 0, Value1 = 10,
34
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...
2
by: Lucky | last post by:
Hi guys, i was working with Enum and one Question strike, i thought it would be good idea to ask more experience guys around. the scenerio is like this : public enum check {
1
by: John A Grandy | last post by:
To convert DataRow column values to enum types , I am using : MyEnum myEnumValue = (MyEnum )Enum.Parse( typeof( MyEnum ), ((int)row).ToString() ); Is there an easier way ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.