Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / Windows Forms

Serialize and Deserialize IEnumerable Objects

Rate me:
Please Sign up or sign in to vote.
4.68/5 (29 votes)
11 Dec 2006CPOL10 min read 393.3K   2.4K   127  
CustomXmlSerializer is an alternative to XmlSerializer, supporting both shallow and deep serialization of ArrayLists, Collections, and Dictionaries.
Namespace Profile
    Public Class Questions
        Inherits System.Collections.CollectionBase

        Public Sub Add(ByVal value As Question)
            MyBase.List.Add(value)
        End Sub

        Default Public ReadOnly Property Item(ByVal Index As Integer) As Question
            Get
                Return CType(MyBase.List.Item(Index), Question)
            End Get
        End Property

        Default Public ReadOnly Property Item(ByVal Identifier As String) As Question
            Get
                For Each _Item As Question In Me
                    If String.Compare(_Item.Identifier.ToString, Identifier, True) = 0 Then
                        Return _Item
                    End If
                Next

                Return Nothing
            End Get
        End Property
    End Class
End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Larry Steinle is a systems analyst for HDR, Inc, a nationally recognized architecture, engineering, and consulting firm. He graduated with a certificate in Biblical Studies, an Associate in Computer Programming, and a Bachelor Degree in Management Information Systems.

Comments and Discussions