Ejemplo n.º 1
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            TerrestrialFrequency newFrequency = new TerrestrialFrequency();
            base.Clone(newFrequency);

            newFrequency.Bandwidth = bandwidth;

            return (newFrequency);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            TerrestrialFrequency newFrequency = new TerrestrialFrequency();

            base.Clone(newFrequency);

            newFrequency.Bandwidth = bandwidth;

            return(newFrequency);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initialize a new instance of the TuningSpec class for a DVB errestrial frequency.
 /// </summary>
 /// <param name="frequency">The terrestrial frequency to tune to.</param>
 public TuningSpec(TerrestrialFrequency frequency)
 {
     this.frequency = frequency;
      bandwidth = frequency.Bandwidth;
 }
Ejemplo n.º 4
0
        internal void load(FileInfo fileInfo)
        {
            TerrestrialFrequency terrestrialFrequency = null;
            XmlReader            reader = null;

            XmlReaderSettings settings = new XmlReaderSettings();

            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);
            }
            catch (IOException)
            {
                Logger.Instance.Write("Failed to open " + fileInfo.Name);
                return;
            }

            try
            {
                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                        case "DVBTTuning":
                            if (terrestrialFrequency != null)
                            {
                                AddFrequency(terrestrialFrequency);
                            }

                            terrestrialFrequency          = new TerrestrialFrequency();
                            terrestrialFrequency.Provider = this;

                            break;

                        default:
                            if (terrestrialFrequency != null)
                            {
                                terrestrialFrequency.load(reader);
                            }
                            break;
                        }
                    }
                }

                if (terrestrialFrequency != null)
                {
                    AddFrequency(terrestrialFrequency);
                }
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }

            if (reader != null)
            {
                reader.Close();
            }
        }
Ejemplo n.º 5
0
        internal void load(FileInfo fileInfo)
        {
            TerrestrialFrequency terrestrialFrequency = null;
            XmlReader reader = null;

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);
            }
            catch (IOException)
            {
                Logger.Instance.Write("Failed to open " + fileInfo.Name);
                return;
            }

            try
            {
                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                            case "DVBTTuning":
                                if (terrestrialFrequency != null)
                                    AddFrequency(terrestrialFrequency);

                                terrestrialFrequency = new TerrestrialFrequency();
                                terrestrialFrequency.Provider = this;

                                break;
                            default:
                                if (terrestrialFrequency != null)
                                    terrestrialFrequency.load(reader);
                                break;
                        }
                    }
                }

                if (terrestrialFrequency != null)
                    AddFrequency(terrestrialFrequency);
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }

            if (reader != null)
                reader.Close();
        }