What I would do is make a class called infoConfig that reads in the data and puts it into like a List. I bet there is a better way to implement it.
public void importArchiveListFromXML(string path)
{
FileInfo fileInfo = new FileInfo(path);
if (fileInfo.Exists)
{
XmlTextReader reader = new XmlTextReader(string.Format(fileInfo.FullName));
reader.WhitespaceHandling = WhitespaceHandling.None;
AddArchiveInfo(reader);
reader.Close();
}
}
public void AddArchiveInfo(XmlTextReader reader)
{
XmlNodeType type;
while (reader.Read())
{
type = reader.NodeType;
if (type == XmlNodeType.Element)
{
if (reader.Name == "Data")
{
Dataread(reader);
}
}
}
}
public void Dataread(XmlTextReader reader)
{
fileExtension = new List<string>();
while (reader.Read())
{
if (reader.Name == "ext")
{
reader.Read();
fileExtension.Add(reader.Value);
reader.Read();
}
}
}