|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
custom serialization..need helpI'm new serialization concepts....I need some hwlp.. I've a class defined as follows class CustomSerialization1 { private string s; public string Test { get { return s; } set { s = value; } } private int i; public int Test1 { get { return i; } set { i = value; } } CustomSerialization1 obj = new CustomSerialization1(); obj.Test = "vijaya,wajid,vani"; object.Test1 = 3; } if want the the output to be sth below after applying serializatiion <Task> <Test> <TestInnner>Vijaya</TestInnner> <TestInnner>wajid</TestInnner> <TestInnner>vani</TestInnner> </Test> <Test1>3</Test3> </Task> Basically I want to control teh way inwhich my Test property will be displayed during serialization and deserialization.... please help me out..just let me know if this is possible by any means... either thru XmlSerialization or Custom Serialziation... See this blog entry:
9/21/2005 XmlSerialization with IDictionary and CollectionBase Objects http://sholliday.spaces.live.com/blog/ It may or may not help. You have ~some control over what items are named. But less control over if they appear as Element or Attribute based. You might consider xml to xml transformation. Show quoteHide quote "AVL" <A**@discussions.microsoft.com> wrote in message news:3F290A57-92A9-480C-87EA-1878EA25C1BF@microsoft.com... > Hi, > I'm new serialization concepts....I need some hwlp.. > I've a class defined as follows > > class CustomSerialization1 > { > private string s; > > public string Test > { > get { return s; } > set { s = value; } > } > > private int i; > > public int Test1 > { > get { return i; } > set { i = value; } > } > CustomSerialization1 obj = new CustomSerialization1(); > obj.Test = "vijaya,wajid,vani"; > object.Test1 = 3; > } > > if want the the output to be sth below after applying serializatiion > > <Task> > <Test> > <TestInnner>Vijaya</TestInnner> > <TestInnner>wajid</TestInnner> > <TestInnner>vani</TestInnner> > </Test> > <Test1>3</Test3> > </Task> > > Basically I want to control teh way inwhich my Test property will be > displayed during serialization and deserialization.... > > > please help me out..just let me know if this is possible by any means... > either thru XmlSerialization or Custom Serialziation...
Other interesting topics
Most popular object persistence framework
Programmatic diagnostic questions about dlls Is This Overkill? serialize a property of a collection Framework, ProtocolType.Icmp and VISTA Using cacheing?? Merging Visual Studio & SDK Help compact framework Right Click Context Menu of a C# windows application not working o DoEvents in c#.net |
|||||||||||||||||||||||