public PersistentProfile(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { if (child.Name == "id") { this.ID = new Guid(child.InnerText); } else if (child.Name == "createdOn") { this.CreatedOn = DateTime.Parse(child.InnerText); } else if (child.Name == "createdBy") { this.CreatedBy = new Guid(child.InnerText); } else if (child.Name == "lastModifiedBy") { this.LastModifiedBy = new Guid(child.InnerText); } else if (child.Name == "lastModifiedOn") { this.LastModifiedOn = DateTime.Parse(child.InnerText); } else if (child.Name == "isActive") { this.IsActive = Boolean.Parse(child.InnerText); } else if (child.Name == "currentResults") { var r = new PersistentNMapResults(child); this.CurrentResults = r; } else if (child.Name == "name") { this.Name = child.InnerText; } else if (child.Name == "duration") { this.Duration = child.InnerText; } else if (child.Name == "description") { this.Description = child.InnerText; } else if (child.Name == "range") { this.Range = child.InnerText; } else if (child.Name == "allResults") { this.AllResults = new List <PersistentNMapResults>(); foreach (XmlNode c in child.ChildNodes) { this.AllResults.Add(new PersistentNMapResults(c)); } } } }
public PersistentProfile(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { if (child.Name == "id") this.ID = new Guid(child.InnerText); else if (child.Name == "createdOn") this.CreatedOn = DateTime.Parse(child.InnerText); else if (child.Name == "createdBy") this.CreatedBy = new Guid(child.InnerText); else if (child.Name == "lastModifiedBy") this.LastModifiedBy = new Guid(child.InnerText); else if (child.Name == "lastModifiedOn") this.LastModifiedOn = DateTime.Parse(child.InnerText); else if (child.Name == "isActive") this.IsActive = Boolean.Parse(child.InnerText); else if (child.Name == "currentResults") { var r = new PersistentNMapResults(child); this.CurrentResults = r; } else if (child.Name == "name") this.Name = child.InnerText; else if (child.Name == "duration") this.Duration = child.InnerText; else if (child.Name == "description") this.Description = child.InnerText; else if (child.Name == "range") this.Range = child.InnerText; else if (child.Name == "allResults") { this.AllResults = new List<PersistentNMapResults>(); foreach (XmlNode c in child.ChildNodes) { this.AllResults.Add(new PersistentNMapResults(c)); } } } }