Ejemplo n.º 1
0
 /// <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)) continue;
         ILineCategory lc = lb.Item as ILineCategory;
         if (lc != null)
         {
             DetailedLineSymbolDialog lsDialog = new 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)
         {
             DetailedPointSymbolDialog dlg = new 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)
         {
             DetailedPolygonSymbolDialog dlg = new 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)
         {
             FeatureLayerDialog layDialog = new FeatureLayerDialog(fl);
             layDialog.ShowDialog();
         }
         IRasterLayer rl = lb.Item as IRasterLayer;
         if(rl != null)
         {
             RasterLayerDialog dlg = new RasterLayerDialog(rl);
             dlg.ShowDialog();
         }
         IColorCategory cb = lb.Item as IColorCategory;
         if(cb != null)
         {
             _tabColorDialog = new TabColorDialog();
             _tabColorDialog.ChangesApplied += new EventHandler(_tabColorDialog_ChangesApplied);
             _tabColorDialog.StartColor = cb.LowColor;
             _tabColorDialog.EndColor = cb.HighColor;
             _editCategory = cb;
             _tabColorDialog.ShowDialog(this);
         }
     }
     base.OnMouseDoubleClick(e);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Occurs when the properties should be shown, and launches a layer dialog.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnShowProperties(HandledEventArgs e)
 {
     FeatureLayerDialog ldg = new FeatureLayerDialog(this);
     ldg.ShowDialog();
     e.Handled = true;
 }