public void AddProgrammsFrom(CChannelData ch)
 {
     foreach (var pr in ch.ProgrammData)
     {
         AddProgramm(pr);
     }
 }
Beispiel #2
0
 public void AddProgrammsFrom(CChannelData ch)
 {
     foreach (var pr in ch.ProgrammData)
     {
         AddProgramm(pr);
     }
 }
Beispiel #3
0
        private void ReadAllChannels(XmlReader xmlReader)
        {
            string s;

            AllChannels.Clear();
            AllChannelsById.Clear();

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

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("XML 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;
                }
                AllChannels.Add(ch);
                AllChannelsById[ch.Id] = ch;
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read())
                    {
                        break;
                    }
                }
            } while (true);
        }
Beispiel #4
0
        void AddChannel(int chnr)
        {
            if (SelectedGroup == null)
            {
                return;
            }
            CChannelData ch   = _TopManager.EPGData.ChannelData[chnr];
            string       chid = ch.Id;

            if (SelectedGroup.Contains(chid))
            {
                return;
            }
            SelectedGroup.Add(chid);
            lbSelected.Items.Add(ch.DisplayNameR);
            _TopManager.EPGUserData.HasChanged = true;
        }
Beispiel #5
0
        void RefreshProgrammList(int dtnr, int chnr)
        {
            txDescr.Text = "";
            lvProgramm.Items.Clear();
            if (dtnr == -1 || chnr == -1)
            {
                return;
            }
            CChannelData ch = _topManager.EPGData.ChannelData[chnr];;
            DateTime     dt = _topManager.UsedDates[dtnr];

            ProgrammList = null;
            if (!ch.ProgrammDataByDate.TryGetValue(dt, out ProgrammList))
            {
                return;
            }

            int           i;
            CProgrammData pd;
            string        sstart, sstop;
            ListViewItem  lvi;

            lvProgramm.BeginUpdate();

            for (i = 0; i < ProgrammList.Count; i++)
            {
                pd     = ProgrammList[i];
                sstart = pd.Start.ToString("HH:mm");
                sstop  = pd.Stop.ToString("HH:mm");
                lvi    = lvProgramm.Items.Add(sstart);
                lvi.SubItems.Add(sstop);
                lvi.SubItems.Add(pd.Title);
            }

            lvProgramm.EndUpdate();

            if (ProgrammList.Count > 0)
            {
                lvProgramm.Items[0].Selected = true;
            }
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
Beispiel #9
0
        private void ReadAllChannels(XmlReader xmlReader)
        {
            string s;

            AllChannels.Clear();
            AllChannelsById.Clear();

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

            if (!xmlReader.ReadToNextSibling("tv"))
            {
                DoError("XML 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;
                AllChannels.Add(ch);
                AllChannelsById[ch.Id] = ch;
                while (xmlReader.NodeType != XmlNodeType.Element)
                {
                    if (!xmlReader.Read()) break;
                }
            } while (true);
        }
Beispiel #10
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);
        }