private static WmtsLocationControl ShowValidWmtsLocationControl(Form form, IWmtsCapabilityFactory wmtsCapabilityFactory) { var control = new WmtsLocationControl(null, wmtsCapabilityFactory); form.Controls.Add(control); ComboBox urlLocations = form.Controls.Find("urlLocationComboBox", true).OfType<ComboBox>().First(); urlLocations.DataSource = new List<WmtsConnectionInfo> { new WmtsConnectionInfo("PDOK achtergrondkaart", "https://geodata.nationaalgeoregister.nl/wmts/top10nlv2?VERSION=1.0.0&request=GetCapabilities") }; var connectToButton = (Button) new ButtonTester("connectToButton", form).TheObject; connectToButton.Enabled = true; return control; }
/// <summary> /// Creates a new instance of <see cref="WmtsLocationControl"/>. /// </summary> /// <param name="activeWmtsMapData">The active <see cref="WmtsMapData"/> or <c>null</c> if none active.</param> /// <param name="wmtsCapabilityFactory">The <see cref="IWmtsCapabilityFactory"/> to use.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="wmtsCapabilityFactory"/> is <c>null</c>.</exception> public WmtsLocationControl(WmtsMapData activeWmtsMapData, IWmtsCapabilityFactory wmtsCapabilityFactory) : base(Resources.WmtsLocationControl_DisplayName) { if (wmtsCapabilityFactory == null) { throw new ArgumentNullException(nameof(wmtsCapabilityFactory)); } this.activeWmtsMapData = activeWmtsMapData; this.wmtsCapabilityFactory = wmtsCapabilityFactory; InitializeComponent(); InitializeWmtsConnectionInfos(); InitializeDataGridView(); InitializeComboBox(); InitializeEventHandlers(); WmtsConnectionInfo selectedWmtsConnectionInfo = PreSelectComboBox(); UpdateComboBoxDataSource(selectedWmtsConnectionInfo); UpdateButtons(); }
private static WmtsLocationControl ShowFullyConfiguredWmtsLocationControl(Form form, IWmtsCapabilityFactory wmtsCapabilityFactory) { WmtsLocationControl control = ShowValidWmtsLocationControl(form, wmtsCapabilityFactory); var capabilities = new[] { new WmtsCapability("-", "image/png", "-", "-"), new WmtsCapability("brtachtergrondkaart(EPSG:28992)", "image/png8", "brtachtergrondkaart", "EPSG:28992") }; DataGridViewControl dataGridViewControl = form.Controls.Find("dataGridViewControl", true).OfType<DataGridViewControl>().First(); dataGridViewControl.SetDataSource(capabilities); return control; }
public override void Setup() { mockRepository = new MockRepository(); tileFactory = mockRepository.StrictMock<ITileSourceFactory>(); wmtsCapabilityFactory = mockRepository.StrictMock<IWmtsCapabilityFactory>(); }