xml serialize instance of class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John A Grandy

    #1

    xml serialize instance of class

    I would like to xml serialize instances of a class solely for the purpose of
    md5 hashing the result and naming data-files with the md5 hash so that there
    is a 1:1 correspondence between a data-file and in instance of my class.

    My class contains references to instances of other classes.

    How would I go about implementing this ?


  • Marc Gravell

    #2
    Re: xml serialize instance of class

    Well, what have you tried? XmlSerializer would be a good place to
    start - msdn has samples on this:

    http://msdn.microsoft.com/en-us/libr...erializer.aspx

    From the title, it sounds like the main issue is the serialization
    (not the MD5 stuff) - is there a specific question on this?

    Marc

    Comment

    • John A Grandy

      #3
      Re: xml serialize instance of class

      I'm not having luck serializing public properties that return instances of
      other classes, or strongly-types lists of instances of other classes.

      How to achieve recursive serialization ?



      "Marc Gravell" <marc.gravell@g mail.comwrote in message
      news:fad49519-1ac1-4193-a171-943aaaa7a43b@y7 9g2000hsa.googl egroups.com...
      Well, what have you tried? XmlSerializer would be a good place to
      start - msdn has samples on this:
      >
      http://msdn.microsoft.com/en-us/libr...erializer.aspx
      >
      From the title, it sounds like the main issue is the serialization
      (not the MD5 stuff) - is there a specific question on this?
      >
      Marc

      Comment

      • Marc Gravell

        #4
        Re: xml serialize instance of class

        What happens? Do you get an exception? Those types must also be
        serializable. Note that XmlSerializer is a *tree* serializer; it won't
        like recursive graphs. DataContractSer ializer can support this, but
        gives different layout.

        Marc

        Comment

        Working...