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 static MenuSettings GetInstance() { if (MenuSettings.Instance == null) { MenuSettings.Instance = new MenuSettings(); } return(MenuSettings.Instance); }
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); } } }