TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kmurthy2
NA
3
0
XmlSerialization - mapping enum variable to xmlelement
Feb 6 2004 9:33 AM
Hi While i'm doing XML serialization in C# class.... I have the following problem... I have an class by name "Operation" In that i have two variables Id and Name and one more enum variable Mode... Mode has got values { Manual , Automatic } I am able to make Id and Name variable as XML Attribute... I want the mode should be represented as either
or
The Operation object should get serialized as
Ship from stock or production
My code looks like public enum ModeEnum {Manual,Automatic} public class WFActivity : WFProperty { private string _id; private string _name; private string _description; private ModeEnum modeenum; [XmlAttribute("Id")] /* sets or gets id */ public string Id { get { return _id; } set { _id = value; } } [XmlAttribute("Name")] /* sets or gets name */ public string Name { get { return _name; } set { _name = value; } } [XmlElement("Description")] /* sets or gets description */ public string Description { get { return _description; } set { _description = value; } } } Pls throw some light on this. Thanks in Advance Keshav
Reply
Answers (
1
)
Parsing an HTML page
Version Compatibility (URGENT)