Basis of a simple xml serializable class inc. a collection
CodeKeep C# Feed Novembre 11th, 2008
Description: Basis of a simple xml serializable class inc. a collection
Link: http://www.codekeep.net/snippets/36ed6afe-5067-44d3-91df-e23b41d17584.aspx
namespace Name.Space
{
[Serializable]
[XmlRoot("RootName")]
public class SerializeSomething
{
private String x;
private List<x> listOfx;
public SerializeSomething()
{
listOfx = new List<x>();
}
[XmlArray(ElementName = "ListName")]
[XmlArrayItem(ElementName = "Item")]
public List<x> SomeList
{
get
{
return listOfx;
}
}
[XmlAttribute(AttributeName = "AttribInRoot")]
public String RootAttrib
{
get
{
//
}
set
{
//
}
}
}






