|
using System;
using System.Collections;
using System.Xml.Serialization;
namespace SerializationSamples
{
public class Exam{
public Exam(){
header=new Header();
questions=new ArrayList();
}
private Header header;
private ArrayList questions;
public Header Header{
get{return header;}
set{header=value;}
}
[XmlArrayItem(typeof(Question))]
public ArrayList Questions{
get{return questions ;}
set{questions=value;}
}
}
public class Header{
public Header(){}
private string title;
private string description;
public string Title{
get{return title;}
set{title=value;}
}
public string Description{
get{return description;}
set{description=value;}
}
}
public class Question{
public Question(){}
private int id;
private string title;
private string[] items;
public int ID{
get{return id;}
set{id=value;}
}
[System.Xml.Serialization.XmlElementAttribute("QuestionTitle")]
public string Title{
get{return title;}
set{title=value;}
}
[System.Xml.Serialization.XmlElementAttribute("Item")]
public string[] Items{
get{return items;}
set{items=value;}
}
}
}
|
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.