Beispiel #1
0
        public bool GetCurrentFromFile()
        {
            if (EpgData1.Source == "api")
            {
                return(false);
            }
            DateTime startdate, enddate;

            if (!GetDates(out startdate, out enddate))
            {
                return(false);
            }
            if (EpgData1.Channels.Count == 0)
            {
                return(true);
            }
            if (bsChannels.Current == null)
            {
                return(false);
            }
            task_cur_ch = bsChannels.Current as EpgChannel;
            task_ch_nr  = EpgData1.Channels.IndexOf(task_cur_ch);
            if (task_ch_nr == -1)
            {
                return(false);
            }
            task_date = startdate;

            task_cur_ch.RemoveDates(startdate, enddate);
            EpgData1.ClearTemp();

            string page = File.ReadAllText(tbURL.Text);
            bool   ret  = task_cur_ch.ReadProgrammsA(page, task_date);

            task_cur_ch.AddFromTemp();
            task_cur_ch.CheckEndTimes();

            return(true);
        }
Beispiel #2
0
        public bool GetCurrentFromFile()
        {
            DateTime startdate, enddate;
            if (!GetDates(out startdate, out enddate)) return false;
            if (EpgData1.Channels.Count == 0) return true;
            if (bsChannels.Current == null) return false;
            task_cur_ch = bsChannels.Current as EpgChannel;
            task_ch_nr = EpgData1.Channels.IndexOf(task_cur_ch);
            if (task_ch_nr == -1) return false;
            task_date = startdate;

            task_cur_ch.RemoveDates(startdate, enddate);
            EpgData1.ClearTemp();

            string page = File.ReadAllText(tbURL.Text);
            bool ret = ReadProgramms(page, task_cur_ch, task_date);

            task_cur_ch.AddFromTemp();
            task_cur_ch.CheckEndTimes();

            return true;
        }
Beispiel #3
0
        public async Task <bool> GetCurrentA()
        {
            DateTime startdate, enddate;

            if (!GetDates(out startdate, out enddate))
            {
                return(false);
            }
            if (EpgData1.Channels.Count == 0)
            {
                return(true);
            }
            if (bsChannels.Current == null)
            {
                return(false);
            }
            task_cur_ch = bsChannels.Current as EpgChannel;
            task_ch_nr  = EpgData1.Channels.IndexOf(task_cur_ch);
            if (task_ch_nr == -1)
            {
                return(false);
            }
            task_do_all      = false;
            task_date_start  = startdate;
            task_date_end    = enddate;
            task_date        = startdate;
            task_cur_progres = 0.0f;

            CalcProgressInc();
            OpenTaskForm();
            task_cancel  = false;
            task_started = true;

            task_cur_ch.RemoveDates(startdate, enddate);
            EpgData1.ClearTemp();

            while (task_date <= task_date_end)
            {
                if (task_cancel)
                {
                    break;
                }

                bool ret = await GetDataA(task_cur_ch, task_date);

                await Task.Delay(200);

                UpdateProgress();
                if (!ret)
                {
                    break;
                }
                task_date = task_date.AddDays(1);
            }

            task_cur_ch.AddFromTemp();
            task_cur_ch.CheckEndTimes();

            Task_done();

            return(true);
        }
Beispiel #4
0
        public async Task<bool> GetCurrent()
        {
            DateTime startdate, enddate;
            if (!GetDates(out startdate, out enddate)) return false;
            if (EpgData1.Channels.Count == 0) return true;
            if (bsChannels.Current == null) return false;
            task_cur_ch = bsChannels.Current as EpgChannel;
            task_ch_nr = EpgData1.Channels.IndexOf(task_cur_ch);
            if (task_ch_nr == -1) return false;
            task_do_all = false;
            task_date_start = startdate;
            task_date_end = enddate;
            task_date = startdate;
            task_cur_progres = 0.0f;
            
            CalcProgressInc();
            OpenTaskForm();
            task_cancel = false;
            task_started = true;

            task_cur_ch.RemoveDates(startdate, enddate);
            EpgData1.ClearTemp();

            while (task_date <= task_date_end)
            {
                if (task_cancel) break;

                bool ret = await GetData(task_cur_ch, task_date);

                await Task.Delay(200);

                UpdateProgress();
                if (!ret) break;
                task_date = task_date.AddDays(1);
            }

            task_cur_ch.AddFromTemp();
            task_cur_ch.CheckEndTimes();
            
            Task_done();

            return true;
        }