Click here to Skip to main content
14,977,980 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

Im having a problem serializing an xml document

My document is structured like this:

As you can see, the "file" elements parent can be either "add" or "edit"

Here are my class objects
Public Class RecentActivities
    <XmlElement("edit"), XmlElement("add")> Public Property Items As ObjectModel.Collection(Of Activity)
End Class

Public Class Activity
    <"I need help here"> Public Property Action As String
    <XmlElement("file")> Public Property Details As FileDetails
End Class

In the code block above i need the "Action" property to be the name of the files parent element "add" or "edit"

How do i do it in one list? is it even possible?

i toyed with 2 lists, one for add and one for edit, but the output is in a specific order thats not always related to the lastmodified element of a file

Thanks in Advance

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900