public MenuLink(XElement element) { this.ID = MenuSettings.GetValidValue(element.Attribute("id")); this.Name = MenuSettings.GetValidValue(element.Attribute("name")); this.Target = MenuSettings.GetValidValue(element.Attribute("target")); this.Url = MenuSettings.GetValidValue(element.Attribute("url")); }
public MenuGroup(XElement element) { this.ID = MenuSettings.GetValidValue(element.Attribute("id")); this.Name = MenuSettings.GetValidValue(element.Attribute("name")); this.Target = MenuSettings.GetValidValue(element.Attribute("target")); this.Links = new List <MenuLink>(); List <XElement> lst = element.Elements("link").ToList(); foreach (XElement item in lst) { MenuLink link = new MenuLink(item); if (!string.IsNullOrEmpty(link.Name)) { this.Links.Add(link); } } }