Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. create xml for collection class

create xml for collection class

Scheduled Pinned Locked Moved C#
questionxmlhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sharon
    wrote on last edited by
    #1

    I succeeded to serialize an object, my problem is to serialize another object that contains an ArrayList of objects. I want to save in the xml each of the objects that are kept in the ArrayList, how can I do it??? thank you very much,sharon

    J 1 Reply Last reply
    0
    • S sharon

      I succeeded to serialize an object, my problem is to serialize another object that contains an ArrayList of objects. I want to save in the xml each of the objects that are kept in the ArrayList, how can I do it??? thank you very much,sharon

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      The collection must be strongly typed in order for the XML Serializer to work. Specifically the indexer must return the type and the IEnumerator implementation of Current must return the same type. There are a couple different strongly typed generators out there, my favorite is CollectionGen from Chris Sells. There is another from Microsoft, which you can find on the GotDotNet website. HTH, James Simplicity Rules!

      S 1 Reply Last reply
      0
      • J James T Johnson

        The collection must be strongly typed in order for the XML Serializer to work. Specifically the indexer must return the type and the IEnumerator implementation of Current must return the same type. There are a couple different strongly typed generators out there, my favorite is CollectionGen from Chris Sells. There is another from Microsoft, which you can find on the GotDotNet website. HTH, James Simplicity Rules!

        S Offline
        S Offline
        sharon
        wrote on last edited by
        #3

        thank you for your help. sharon :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups