/// <summary> /// Called when the apply (or ok) button is pressed. /// </summary> private void _apply(CadKit.Interfaces.IOptionsForm form, CadKit.Interfaces.IOptionsPage page) { CadKit.Interfaces.ILayerList layerList = CadKit.Documents.Manager.Instance.ActiveDocument as CadKit.Interfaces.ILayerList; if (null != layerList && _server.Text.Length > 0 && _cacheDirectory.Text.Length > 0) { CadKit.OSSIMPlanet.Glue.WmsLayer wmsLayer = new CadKit.OSSIMPlanet.Glue.WmsLayer(); wmsLayer.Server = _server.Text; wmsLayer.CacheDirectory = _cacheDirectory.Text; if (_jpeg.Checked) { wmsLayer.ImageType = "image/jpeg"; } else if (_png.Checked) { wmsLayer.ImageType = "image/png"; } layerList.addLayer(wmsLayer, this); WmsSettings settings = new WmsSettings(); settings.Server = wmsLayer.Server; settings.CacheDirectory = wmsLayer.CacheDirectory; settings.ImageType = wmsLayer.ImageType; if (false == _recentServers.Contains(settings)) { _recentServers.Add(settings); _recent.Items.Add(settings.Server); } } }
/// <summary> /// Called when the apply (or ok) button is pressed. /// </summary> private void _apply(CadKit.Interfaces.IOptionsForm form, CadKit.Interfaces.IOptionsPage page) { CadKit.Interfaces.ILayerList layerList = CadKit.Documents.Manager.Instance.ActiveDocument as CadKit.Interfaces.ILayerList; if (null != layerList) { foreach (CadKit.Interfaces.ILayer layer in _layers) { layerList.addLayer(layer, this); } } }