Пример #1
0
        /// <summary>
        /// Read in the channel settings from the given XML file.
        /// This tells us what channels we are interested in from the xmltv file and matches them up
        /// with the MXF fiel entries generated.
        /// </summary>
        /// <param name="fName">The name of the XML file containing the channel settings.</param>
        static void readChannelSettings(string fName)
        {
            // we are going to load up the channel settings
            logger.Debug("About to open: " + fName);
            XmlTextReader xmlChannels = new XmlTextReader(fName);

            while (xmlChannels.Read())
            {
                if (xmlChannels.NodeType == XmlNodeType.Element && xmlChannels.Depth < 3)
                {
                    if ((xmlChannels.Name == "Channel"))
                    {
                        //logger.Debug(xmlChannels.ReadOuterXml());
                        string cid  = xmlChannels.GetAttribute("cid");
                        string name = xmlChannels.GetAttribute("name");
                        if (name == null)
                        {
                            name = cid;
                        }
                        TVChannel newChannel = new TVChannel(channels.Count + 1, name, cid);
                        newChannel.logoURL = xmlChannels.GetAttribute("logo");
                        channels.Add(newChannel);
                        //logger.Debug("Processed Channel :" + newChannel.name_ + " from " + fName);
                    }
                }
            }
            xmlChannels.Close();
        }
Пример #2
0
        /// <summary>
        /// Read in the channel settings from the given XML file.
        /// This tells us what channels we are interested in from the xmltv file and matches them up
        /// with the MXF fiel entries generated.
        /// </summary>
        /// <param name="fName">The name of the XML file containing the channel settings.</param>
        static void readChannelSettings(string fName)
        {
            // we are going to load up the channel settings
                logger.Debug("About to open: " + fName);
                XmlTextReader xmlChannels = new XmlTextReader(fName);
                while (xmlChannels.Read())
                {
                    if (xmlChannels.NodeType == XmlNodeType.Element && xmlChannels.Depth < 3)
                    {
                        if ((xmlChannels.Name == "Channel"))
                        {
                            //logger.Debug(xmlChannels.ReadOuterXml());
                            string cid = xmlChannels.GetAttribute("cid");
                            string name = xmlChannels.GetAttribute("name");
                            if (name == null) name = cid;
                            TVChannel newChannel = new TVChannel(channels.Count + 1, name, cid);
                            newChannel.logoURL = xmlChannels.GetAttribute("logo");
                            channels.Add(newChannel);
                            //logger.Debug("Processed Channel :" + newChannel.name_ + " from " + fName);
                        }
                    }

                }
                xmlChannels.Close();
        }