} // class MappedService protected IEnumerable <UiServiceProvider> GetProviders() { var baseIpAddress = AppUiConfiguration.Current.ContentProvider.Bootstrap.MulticastAddress; var discoveryXml = AppUiConfiguration.Current.Cache.LoadXml <ProviderDiscoveryRoot>("ProviderDiscovery", baseIpAddress); if (discoveryXml == null) { using (var dialog = new SelectProviderDialog()) { dialog.ShowDialog(Owner); discoveryXml = AppUiConfiguration.Current.Cache.LoadXml <ProviderDiscoveryRoot>("ProviderDiscovery", baseIpAddress); if (discoveryXml == null) { return(null); } } // using dialog } // if var providers = from discovery in discoveryXml.ServiceProviderDiscovery from provider in discovery.Providers let uiProvider = new UiServiceProvider(provider) select uiProvider; return(providers); } // GetProviders
public DbProvider SelectProvider() { DbProvider provider = null; using (SelectProviderDialog providerDialog = new SelectProviderDialog()) { FormExtensions.DownPositionate(providerDialog, this.toolStrip); if (providerDialog.ShowDialog(this) == DialogResult.OK) { provider = providerDialog.Provider; } } return(provider); }
} // Implementation_menuItemProviderDetails_Click private void SelectProvider() { using (var dialog = new SelectProviderDialog()) { dialog.SelectedServiceProvider = SelectedServiceProvider; var result = dialog.ShowDialog(this); BasicGoogleTelemetry.SendScreenHit(this); if (result != DialogResult.OK) { return; } SelectedServiceProvider = dialog.SelectedServiceProvider; ServiceProviderChanged(); } // dialog } // SelectProvider
} // ChannelListForm_FormClosing #endregion #region Form event handlers implementation private void ChannelListForm_Load_Implementation(object sender, EventArgs e) { BasicGoogleTelemetry.SendScreenHit(this, "Load"); this.Text = Properties.Texts.AppCaption; // disable functionality menuItemDvbRecent.Enabled = enable_menuItemDvbRecent; menuItemDvbPackages.Enabled = enable_menuItemDvbPackages; menuItemDvbExport.Enabled = enable_menuItemDvbExport; var settings = UiBroadcastListSettingsRegistration.Settings; ListManager = new UiBroadcastListManager(listViewChannelList, settings, imageListChannels, imageListChannelsLarge, true); ListManager.SelectionChanged += ListManager_SelectionChanged; ListManager.StatusChanged += ListManager_StatusChanged; SetupContextMenuList(); // Empty notifications Notify(null, null, -1); // set-up EPG functionality EpgDatastore = new EpgMemoryDatastore(); enable_Epg = AppUiConfiguration.Current.User.Epg.Enabled; epgMiniGuide.IsDisabled = !enable_Epg; if (epgMiniGuide.IsDisabled) { foreach (ToolStripItem item in menuItemEpg.DropDownItems) { item.Enabled = false; } // foreach } // if // load from cache, if available SelectedServiceProvider = SelectProviderDialog.GetLastUserSelectedProvider(Properties.Settings.Default.LastSelectedServiceProvider); ServiceProviderChanged(); // notify Splash Screeen the form has finished loading and is about to be shown FormLoadCompleted?.Invoke(this, e); } // ChannelListForm_Load_Implementation
} // LoadDisplayProgress private bool SelectProvider(bool useSelected = true) { if ((SelectedServiceProvider != null) && (useSelected)) { return(true); } using (var dialog = new SelectProviderDialog()) { dialog.SelectedServiceProvider = SelectedServiceProvider; var result = dialog.ShowDialog(this); if (result != DialogResult.OK) { return(false); } SelectedServiceProvider = dialog.SelectedServiceProvider; labelServiceProvider.Text = SelectedServiceProvider.DisplayName; } // using dialog return(true); } // SelectProvider