/// <summary> /// When the user double clicks the cell then we should display the detailed /// symbology dialog /// </summary> private void DgvCategoriesCellDoubleClick(object sender, DataGridViewCellEventArgs e) { int count = _newScheme.Categories.Count; if (e.ColumnIndex == 0 && e.RowIndex < count) { _dblClickEditIndex = e.RowIndex; _tabColorDialog = new TabColorDialog(); _tabColorDialog.ChangesApplied += TabColorDialogChangesApplied; _tabColorDialog.StartColor = _newScheme.Categories[_dblClickEditIndex].LowColor; _tabColorDialog.EndColor = _newScheme.Categories[_dblClickEditIndex].HighColor; _tabColorDialog.Show(ParentForm); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnMouseDoubleClick(MouseEventArgs e) { _wasDoubleClick = true; Point loc = new Point(e.X + ControlRectangle.X, e.Location.Y + ControlRectangle.Top); foreach (LegendBox lb in _legendBoxes) { if (!lb.Bounds.Contains(loc) || lb.CheckBox.Contains(loc)) { continue; } ILineCategory lc = lb.Item as ILineCategory; if (lc != null) { GIS.Common.Dialogs.DetailedLineSymbolDialog lsDialog = new GIS.Common.Dialogs.DetailedLineSymbolDialog(lc.Symbolizer); lsDialog.ShowDialog(); ILineSymbolizer sel = lc.Symbolizer.Copy(); sel.SetFillColor(Color.Cyan); lc.SelectionSymbolizer = sel; } IPointCategory pc = lb.Item as IPointCategory; if (pc != null) { GIS.Common.Dialogs.DetailedPointSymbolDialog dlg = new GIS.Common.Dialogs.DetailedPointSymbolDialog(pc.Symbolizer); dlg.ShowDialog(); IPointSymbolizer ps = pc.Symbolizer.Copy(); ps.SetFillColor(Color.Cyan); pc.SelectionSymbolizer = ps; } IPolygonCategory polyCat = lb.Item as IPolygonCategory; if (polyCat != null) { GIS.Common.Dialogs.DetailedPolygonSymbolDialog dlg = new GIS.Common.Dialogs.DetailedPolygonSymbolDialog(polyCat.Symbolizer); dlg.ShowDialog(); IPolygonSymbolizer ps = polyCat.Symbolizer.Copy(); ps.SetFillColor(Color.Cyan); ps.OutlineSymbolizer.SetFillColor(Color.DarkCyan); polyCat.SelectionSymbolizer = ps; } IFeatureLayer fl = lb.Item as IFeatureLayer; if (fl != null) { GIS.Common.Dialogs.LayerDialog layDialog = new GIS.Common.Dialogs.LayerDialog(fl, new FeatureCategoryControl()); layDialog.ShowDialog(); } IRasterLayer rl = lb.Item as IRasterLayer; if (rl != null) { GIS.Common.Dialogs.LayerDialog dlg = new GIS.Common.Dialogs.LayerDialog(rl, new RasterCategoryControl()); dlg.ShowDialog(); } IColorCategory cb = lb.Item as IColorCategory; if (cb != null) { _tabColorDialog = new TabColorDialog(); _tabColorDialog.ChangesApplied += TabColorDialogChangesApplied; _tabColorDialog.StartColor = cb.LowColor; _tabColorDialog.EndColor = cb.HighColor; _editCategory = cb; _tabColorDialog.ShowDialog(this); } } base.OnMouseDoubleClick(e); }