Exemplo n.º 1
0
        public void ReadData(XmlReader xmlReader)
        {
            string s;

            ChannelData.Clear();
            ChannelDataById.Clear();

            if (xmlReader.ReadState == ReadState.Initial)
            {
                xmlReader.Read();
            }

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("No tv node");
                return;
            }
            if (!xmlReader.ReadToDescendant("channel"))
            {
                DoError("XML no channels");
                return;
            }
            if (xmlReader.NodeType != XmlNodeType.Element)
            {
                DoError("XML no Element node");
                return;
            }

            s = "";
            CChannelData ch = null;

            do
            {
                ch = new CChannelData();
                if (!ch.ReadXML(xmlReader))
                {
                    break;
                }
                ChannelData.Add(ch);
                ChannelDataById[ch.Id] = ch;
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read())
                    {
                        break;
                    }
                }
            } while (true);


            while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
            {
            }

            CProgrammData pd;

            do
            {
                pd = new CProgrammData();
                if (!pd.ReadXML(xmlReader))
                {
                    break;
                }
                if (ChannelDataById.TryGetValue(pd.ChId, out ch))
                {
                    ch.AddProgramm(pd);
                }
                while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
                {
                }
            } while (true);
        }
Exemplo n.º 2
0
        private void ReadData(XmlReader xmlReader)
        {
            string s;

            Channels.Clear();
            ChannelsById.Clear();

            if (xmlReader.ReadState == ReadState.Initial) xmlReader.Read();

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("No tv node");
                return;
            }
            if (!xmlReader.ReadToDescendant("channel"))
            {
                DoError("XML no channels");
                return;
            }
            if (xmlReader.NodeType != XmlNodeType.Element)
            {
                DoError("XML no Element node");
                return;
            }

            s = "";
            CChannelData ch = null;

            do
            {
                ch = new CChannelData();
                if (!ch.ReadXML(xmlReader)) break;
                if (KeepChannelsById.ContainsKey(ch.Id))
                {
                    ch.Prefix = Prefix;
                    if (!RenameChannelsIds.TryGetValue(ch.Id, out ch.DisplayName2))
                    {
                        ch.DisplayName2 = "";
                    }
                    Channels.Add(ch);
                    ChannelsById[ch.Id] = ch;
                }
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read()) break;
                }
            } while (true);

            while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read()) { }

            CProgrammData pd;
            do
            {
                pd = new CProgrammData();
                if (!pd.ReadXML(xmlReader)) break;
                if (KeepChannelsById.ContainsKey(pd.ChId))
                {
                    if (ChannelsById.TryGetValue(pd.ChId, out ch))
                    {
                        ch.AddProgramm(pd);
                    }
                }
                while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read()) { }
            } while (true);
        }
Exemplo n.º 3
0
        public void ReadData(XmlReader xmlReader)
        {
            string s;

            ChannelData.Clear();
            ChannelDataById.Clear();

            if (xmlReader.ReadState == ReadState.Initial) xmlReader.Read();

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("No tv node");
                return;
            }
            if (!xmlReader.ReadToDescendant("channel"))
            {
                DoError("XML no channels");
                return;
            }
            if (xmlReader.NodeType != XmlNodeType.Element)
            {
                DoError("XML no Element node");
                return;
            }

            s = "";
            CChannelData ch = null;

            do
            {
                ch = new CChannelData();
                if (!ch.ReadXML(xmlReader)) break;
                ChannelData.Add(ch);
                ChannelDataById[ch.Id] = ch;
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read()) break;
                }
            } while (true);

            while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
            {}

            CProgrammData pd;
            do
            {
                pd = new CProgrammData();
                if (!pd.ReadXML(xmlReader)) break;
                if (ChannelDataById.TryGetValue(pd.ChId, out ch))
                {
                    ch.AddProgramm(pd);
                }
                while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
                {}
            } while (true);
        }
Exemplo n.º 4
0
        private void ReadData(XmlReader xmlReader)
        {
            string s;

            Channels.Clear();
            ChannelsById.Clear();

            if (xmlReader.ReadState == ReadState.Initial)
            {
                xmlReader.Read();
            }

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("No tv node");
                return;
            }
            if (!xmlReader.ReadToDescendant("channel"))
            {
                DoError("XML no channels");
                return;
            }
            if (xmlReader.NodeType != XmlNodeType.Element)
            {
                DoError("XML no Element node");
                return;
            }

            s = "";
            CChannelData ch = null;

            do
            {
                ch = new CChannelData();
                if (!ch.ReadXML(xmlReader))
                {
                    break;
                }
                if (KeepChannelsById.ContainsKey(ch.Id))
                {
                    ch.Prefix = Prefix;
                    if (!RenameChannelsIds.TryGetValue(ch.Id, out ch.DisplayName2))
                    {
                        ch.DisplayName2 = "";
                    }
                    Channels.Add(ch);
                    ChannelsById[ch.Id] = ch;
                }
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read())
                    {
                        break;
                    }
                }
            } while (true);


            while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
            {
            }

            CProgrammData pd;

            do
            {
                pd = new CProgrammData();
                if (!pd.ReadXML(xmlReader))
                {
                    break;
                }
                if (KeepChannelsById.ContainsKey(pd.ChId))
                {
                    if (ChannelsById.TryGetValue(pd.ChId, out ch))
                    {
                        ch.AddProgramm(pd);
                    }
                }
                while (xmlReader.NodeType != XmlNodeType.Element && xmlReader.Read())
                {
                }
            } while (true);
        }