/// <summary>
        /// Loads the menu structures.
        /// </summary>
        /// <returns></returns>
        public MenuStructureList LoadMenuStructures()
        {
            try
              {
            MenuStructureList msList = new MenuStructureList();
            XDocument xDoc = XDocument.Load(TeletextStructureXml);
            XNamespace xNs = TeletextStructureSchemaNamespace;
            var msQuery = from menuStructure in xDoc.Descendants(xNs + "TeletextStructure").Descendants(xNs + "MenuStructure")
                          select menuStructure;

            foreach (XElement element in msQuery)
            {
              msList.Add(new MenuStructure()
              {
                SiteNumber = Int32.Parse(element.Descendants(xNs + "SiteNumber").FirstOrDefault().Value),
                Title = element.Descendants(xNs + "Title").FirstOrDefault().Value
              });
            }

            return msList;
              }
              catch (Exception ex)
              {
            throw new Exception(ex.Message);
              }
        }
Example #2
0
        public DataContract.MenuStructureList GetMenuStructure()
        {
            MenuStructureList menuList = new MenuStructureList();
            menuList.Add(new MenuStructure() { SiteNumber = 101, Title = "News" });
            menuList.Add(new MenuStructure() { SiteNumber = 200, Title = "Sport" });
            menuList.Add(new MenuStructure() { SiteNumber = 300, Title = "TV/Radio" });
            menuList.Add(new MenuStructure() { SiteNumber = 400, Title = "Reisen" });
            menuList.Add(new MenuStructure() { SiteNumber = 500, Title = "Konsum" });
            menuList.Add(new MenuStructure() { SiteNumber = 600, Title = "Finanzen" });
            menuList.Add(new MenuStructure() { SiteNumber = 700, Title = "Entertainment" });
            menuList.Add(new MenuStructure() { SiteNumber = 800, Title = "Freizeit" });

            return menuList;
        }