示例#1
0
 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"));
 }
示例#2
0
 public static MenuSettings GetInstance()
 {
     if (MenuSettings.Instance == null)
     {
         MenuSettings.Instance = new MenuSettings();
     }
     return(MenuSettings.Instance);
 }
示例#3
0
        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);
                }
            }
        }