예제 #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);
                }
            }
        }