dannyvk100
Gebruiker
- Lid geworden
- 7 feb 2012
- Berichten
- 19
Hallo mensen,
Ik wil mijn object list gegevens in een listview plaatsen op 't form maar hoe doe ik dat precies?
Dit is mijn code:
Moet dit met een Getter en een Setter? Zo ja hoe? Alvast bedankt.
Ik wil mijn object list gegevens in een listview plaatsen op 't form maar hoe doe ik dat precies?
Dit is mijn code:
Code:
public class LogLine
{
public string date;
public string time;
public string swversion;
public string pc;
public string user;
public string action;
public string table;
public string id;
public string statement;
public LogLine(string date, string time, string swversion, string pc, string user, string action, string table, string id, string statement)
{
this.date = date;
this.time = time;
this.swversion = swversion;
this.pc = pc;
this.user = user;
this.action = action;
this.table = table;
this.id = id;
this.statement = statement;
}
public static void LoadXMLValues()
{
List<LogLine> lines = new List<LogLine>();
XmlDocument doc = new XmlDocument();
doc.Load("C:\\Project/HVL/SSPS/SSPS/bin/Debug/Log/LogFile.xml");
XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("/TABLE/LOG");
foreach (XmlNode node in nodes)
{
lines.Add(new LogLine(node["DATE"].InnerText, node["TIME"].InnerText, node["SWVERSION"].InnerText, node["PC"].InnerText, node["USER"].InnerText, node["ACTION"].InnerText, node["TABLE"].InnerText, node["ID"].InnerText, node["STATEMENT"].InnerText)); ;
}
}
}
Laatst bewerkt door een moderator: