private void ShowMap() { if (_map == null) { _map = PluginManager.Instance.AddNonDockableContent(this, new MapControl(MapMode.Normal), "Map Tool", SizeToContent.Manual); _map.Closed += (sender, e) => { _map = null; }; } _map.Show(); _map.Focus(); }
public void SelectRegions(List <RegionDescriptor> preselectedRegions, Action <List <RegionDescriptor> > updatefunc) { if (_regionMap == null) { var map = new MapControl(MapMode.RegionSelect, updatefunc); _regionMap = PluginManager.Instance.AddNonDockableContent(this, map, "Region Selection Tool", SizeToContent.Manual); _regionMap.Closed += (sender, e) => { _regionMap = null; }; } var mapControl = _regionMap.Control as MapControl; if (mapControl != null) { mapControl.SelectRegions(preselectedRegions); } _regionMap.Show(); _regionMap.Focus(); }
private Gazetteer ShowEGaz() { if (Preferences.UseFloatingEGaz.Value) { if (_gazetteerContrib != null) { ErrorMessage.Show("You will need to restart BioLink so that your preferences can be applied"); return(null); } if (_gazWindow == null) { _gazWindow = PluginManager.AddNonDockableContent(this, _gazetteer, _R("Gazetteer.Title"), SizeToContent.Manual, true); _gazWindow.Owner = PluginManager.Instance.ParentWindow; _gazWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; _gazWindow.Closed += new EventHandler((s, e) => { _gazWindow = null; }); } _gazWindow.Show(); _gazWindow.BringIntoView(); _gazWindow.Focus(); return(_gazWindow.Control as Gazetteer); } else { if (_gazetteerContrib != null) { PluginManager.EnsureVisible(this, "Gazetteer"); return(_gazetteerContrib.ContentControl as Gazetteer); } else { ErrorMessage.Show("You will need to restart BioLink so that your preferences can be applied"); return(null); } } }
public void ShowRegionExplorer(Action <SelectionResult> selectionFunc = null) { if (_regionExplorer == null) { var explorer = new DistributionRegionExplorer(this, User); _regionExplorer = PluginManager.Instance.AddNonDockableContent(this, explorer, "Distribution Region Explorer", SizeToContent.Manual); _regionExplorer.Closed += (sender, e) => { _regionExplorer.Dispose(); _regionExplorer = null; }; } if (_regionExplorer != null) { if (selectionFunc != null) { _regionExplorer.BindSelectCallback(selectionFunc); } _regionExplorer.Show(); } }
public void SelectRegions(List<RegionDescriptor> preselectedRegions, Action<List<RegionDescriptor>> updatefunc) { if (_regionMap == null) { var map = new MapControl(MapMode.RegionSelect, updatefunc); _regionMap = PluginManager.Instance.AddNonDockableContent(this, map, "Region Selection Tool", SizeToContent.Manual); _regionMap.Closed += (sender, e) => { _regionMap = null; }; } var mapControl = _regionMap.Control as MapControl; if (mapControl != null) { mapControl.SelectRegions(preselectedRegions); } _regionMap.Show(); _regionMap.Focus(); }