示例#1
0
 /// <summary>
 /// Creates the instance by parsing the Teletext node in the configuration file
 /// </summary>
 /// <param name="xmlNode">The Teletext xml node</param>
 /// <returns>Teletext instance</returns>
 public static Teletext CreateInstance(XmlNode xmlNode)
 {
   Teletext teletext = new Teletext();
   if (xmlNode != null)
   {
     XmlNode nameNode = xmlNode.SelectSingleNode("name");
     XmlNode categoryNode = xmlNode.SelectSingleNode("category");
     try
     {
       teletext.Category = new Guid(
         categoryNode.InnerText);
     }
     catch
     {
       return teletext;
     }
     teletext.Name = nameNode.InnerText;
   }
   return teletext;
 }
        /// <summary>
        /// Creates the instance by parsing the Teletext node in the configuration file
        /// </summary>
        /// <param name="xmlNode">The Teletext xml node</param>
        /// <returns>Teletext instance</returns>
        public static Teletext CreateInstance(XmlNode xmlNode)
        {
            Teletext teletext = new Teletext();

            if (xmlNode != null)
            {
                XmlNode nameNode     = xmlNode.SelectSingleNode("name");
                XmlNode categoryNode = xmlNode.SelectSingleNode("category");
                try
                {
                    teletext.Category = new Guid(
                        categoryNode.InnerText);
                }
                catch
                {
                    return(teletext);
                }
                teletext.Name = nameNode.InnerText;
            }
            return(teletext);
        }
示例#3
0
        /// <summary>
        /// Creates the Graph instance which represents an analog graph
        /// </summary>
        /// <param name="xmlNode">The graph xml node</param>
        /// <returns>Graph instance</returns>
        public static Graph CreateInstance(XmlNode xmlNode)
        {
            Graph   graph        = new Graph();
            XmlNode tunerNode    = null;
            XmlNode tvAudioNode  = null;
            XmlNode crossbarNode = null;
            XmlNode captureNode  = null;
            XmlNode teletextNode = null;

            if (xmlNode != null)
            {
                tunerNode    = xmlNode.SelectSingleNode("tuner");
                tvAudioNode  = xmlNode.SelectSingleNode("tvAudio");
                crossbarNode = xmlNode.SelectSingleNode("crossbar");
                captureNode  = xmlNode.SelectSingleNode("capture");
                teletextNode = xmlNode.SelectSingleNode("teletext");
            }
            graph.Tuner    = Tuner.CreateInstance(tunerNode);
            graph.TvAudio  = TvAudio.CreateInstance(tvAudioNode);
            graph.Crossbar = Crossbar.CreateInstance(crossbarNode);
            graph.Capture  = Capture.CreateInstance(captureNode);
            graph.Teletext = Teletext.CreateInstance(teletextNode);
            return(graph);
        }