public FormPreRenderTiles(TileServiceMetadata metadata, MapServerClass mapServerClass) { _metadata = metadata; _mapServerClass = mapServerClass; InitializeComponent(); if (_metadata != null) { foreach (int epsg in _metadata.EPSGCodes) { cmbEpsg.Items.Add(epsg); } if (cmbEpsg.Items.Count > 0) { cmbEpsg.SelectedIndex = 0; } } if (_mapServerClass != null && _mapServerClass.Dataset != null) { txtServer.Text = ConfigTextStream.ExtractValue(_mapServerClass.Dataset.ConnectionString, "server"); txtService.Text = ConfigTextStream.ExtractValue(_mapServerClass.Dataset.ConnectionString, "service"); } numMaxParallelRequest.Value = _maxParallelRequests; if (metadata.FormatPng) { cmbImageFormat.Items.Add("image/png"); } if (metadata.FormatJpg) { cmbImageFormat.Items.Add("image/jpeg"); } if (metadata.UpperLeft && metadata.UpperLeftCacheTiles) { cmbOrigin.Items.Add("Upper Left"); } if (metadata.LowerLeft && metadata.LowerLeftCacheTiles) { cmbOrigin.Items.Add("Lower Left"); } if (cmbImageFormat.Items.Count > 0) { cmbImageFormat.SelectedIndex = 0; } if (cmbOrigin.Items.Count > 0) { cmbOrigin.SelectedIndex = 0; } if (cmbCacheFormat.Items.Count > 0) { cmbCacheFormat.SelectedIndex = 0; } }
async public Task <object> GetInstanceAsync() { if (_class == null) { MapServerDataset dataset = new MapServerDataset(_connectionString, _name); // dataset.Open(); // kein open, weil sonst GET_SERVICE_INFO gemacht wird... var elements = await dataset.Elements(); if (elements.Count == 0) { dataset.Dispose(); return(null); } _class = (await dataset.Elements()).FirstOrDefault()?.Class as MapServerClass; } return(_class); }