public static SearchLayerModifier Create(ILayer layer, Map map, DataDownloadPlugin downloadPlugin) { if (!IsSearchLayer(layer)) { return(null); } return(new SearchLayerModifier((FeatureLayer)layer, map, downloadPlugin)); }
/// <summary> /// Creates new instance of <see cref="CustomToolTipControl"/> class. /// </summary> /// <param name="parentPlugin">DataDownloadPlugin</param> public CustomToolTipControl(DataDownloadPlugin parentPlugin) { _parentPlugin = parentPlugin; InitializeComponent(); SizeChanged += CustomToolTipControl_SizeChanged; Load += CustomToolTipControl_Load; }
/// <summary> /// Create instance of <see cref="SearchLayerInformer"/> /// </summary> /// <param name="parentPlugin">DataDownload plugin</param> /// <param name="serviceInfoExtractor">Instance of IServiceInfoExtractor</param> /// <param name="map">Map</param> /// <exception cref="ArgumentNullException">serviceInfoExtractor must be not null.</exception> public SearchLayerInformer(DataDownloadPlugin parentPlugin, IServiceInfoExtractor serviceInfoExtractor, Map map) { if (parentPlugin == null) { throw new ArgumentNullException("parentPlugin"); } if (serviceInfoExtractor == null) { throw new ArgumentNullException("serviceInfoExtractor"); } if (map == null) { throw new ArgumentNullException("map"); } _parentPlugin = parentPlugin; _serviceInfoExtractor = serviceInfoExtractor; _map = map; toolTip = new Popup(customToolTip = new CustomToolTipControl(_parentPlugin)); customToolTip.Popup = toolTip; toolTip.AutoClose = false; toolTip.FocusOnOpen = false; toolTip.ShowingAnimation = toolTip.HidingAnimation = PopupAnimations.Blend; toolTip.TopLevel = false; _parentPlugin.ShowPopupsChanged += OnParentPluginOnShowPopupsChanged; _map.MouseMove += _map_MouseMove; _map.VisibleChanged += MapOnVisibleChanged; var parent = _map.Parent; while (parent != null) { parent.VisibleChanged += MapOnVisibleChanged; var form = parent as Form; if (form != null) { toolTip.Parent = form; } parent = parent.Parent; } Debug.Assert(toolTip.Parent != null); }
private SearchLayerModifier(FeatureLayer layer, Map map, DataDownloadPlugin downloadPlugin) { if (layer == null) { throw new ArgumentNullException("layer"); } if (map == null) { throw new ArgumentNullException("map"); } if (downloadPlugin == null) { throw new ArgumentNullException("downloadPlugin"); } Contract.EndContractBlock(); _layer = layer; _map = map; _downloadPlugin = downloadPlugin; }