public InstallLog(XmlElement element)
{
string dateString = element.GetAttribute("dateTime");
string resultString = element.GetAttribute("result");
if (!string.IsNullOrWhiteSpace(dateString))
{
DateTime dateTime;
if (DateTime.TryParse(dateString, out dateTime))
this.Date = dateTime;
}
if (!string.IsNullOrWhiteSpace(resultString))
{
InstallState result;
if (Enum.TryParse(resultString, true, out result))
this.Result = result;
}
this.Items = new List<InstallItem>();
foreach (XmlElement fileElem in element.SelectNodes("files/file"))
{
InstallItem file = this.AddFile(fileElem.GetAttribute("path"));
file.CrcCode = fileElem.GetAttribute("crc");
string stateString = fileElem.GetAttribute("state");
if (!string.IsNullOrWhiteSpace(stateString))
{
InstallState state;
if (Enum.TryParse(resultString, true, out state))
file.State = state;
}
}
}