コード例 #1
0
        }     // menuItemHelpAbout_Click_Implementation

        #endregion

        #region Auxiliary methods: providers

        private void ServiceProviderChanged()
        {
            Properties.Settings.Default.LastSelectedServiceProvider = (SelectedServiceProvider != null) ? SelectedServiceProvider.Key : null;
            Properties.Settings.Default.Save();

            if (SelectedServiceProvider == null)
            {
                labelProviderName.Text             = Properties.Texts.NotSelectedServiceProvider;
                labelProviderDescription.Text      = null;
                pictureProviderLogo.Image          = null;
                menuItemProviderDetails.Enabled    = false;
                menuItemChannelRefreshList.Enabled = false;
                menuItemChannelEditList.Enabled    = false;
                SetBroadcastDiscovery(null);

                return;
            } // if

            labelProviderName.Text        = SelectedServiceProvider.DisplayName;
            labelProviderDescription.Text = SelectedServiceProvider.DisplayDescription;
            pictureProviderLogo.Image     = SelectedServiceProvider.Logo.GetImage(LogoSize.Size32, true);

            menuItemProviderDetails.Enabled    = true;
            menuItemChannelRefreshList.Enabled = true;
            menuItemChannelEditList.Enabled    = true;

            // TODO: clean-up
            var downloader = new EpgDownloader("239.0.2.145:3937");

            downloader.StartAsync(EpgDatastore);
            // UpdateEpgData();

            SetBroadcastDiscovery(null);
            LoadBroadcastDiscovery(true);
        } // ServiceProviderChanged
コード例 #2
0
        protected override int Run(string[] args)
        {
            var datastore  = new EpgMemoryDatastore();
            var downloader = new EpgDownloader("239.0.2.145:3937");

            Console.WriteLine("Start");

            var task = downloader.StartAsync(datastore);

            task.Wait(new TimeSpan(0, 10, 0));

            Console.WriteLine("Ended");

            return(0);
        } // Run