Пример #1
0
 /// <summary>
 /// Show the properties of a feature layer in the legend.
 /// </summary>
 /// <param name="layer">Layer whose properties are shown.</param>
 public void ShowProperties(IFeatureLayer layer)
 {
     using (var dlg = new LayerDialog(layer, new FeatureCategoryControl()))
     {
         ShowDialog(dlg);
     }
 }
Пример #2
0
 /// <summary>
 /// Show the properties of an image layer in the legend.
 /// </summary>
 /// <param name="e"></param>
 public void ShowProperties(IImageLayer e)
 {
     using (var dlg = new LayerDialog(e, new ImageCategoryControl()))
     {
         ShowDialog(dlg);
     }
 }
Пример #3
0
 /// <summary>
 /// Show the properties of a feature layer in the legend.
 /// </summary>
 /// <param name="e"></param>
 public void ShowProperties(IFeatureLayer e)
 {
     using (var dlg = new LayerDialog(e, new FeatureCategoryControl()))
     {
         ShowDialog(dlg);
     }
 }
Пример #4
0
 /// <summary>
 /// Shows the properties of the current raster legend item.
 /// </summary>
 /// <param name="e"></param>
 public void ShowProperties(IRasterLayer e)
 {
     using (var dlg = new LayerDialog(e, new RasterCategoryControl()))
     {
         ShowDialog(dlg);
     }
 }
Пример #5
0
 /// <summary>
 /// Shows the properties of the current raster legend item.
 /// </summary>
 /// <param name="layer">The raster layer</param>
 public void ShowProperties(IRasterLayer layer)
 {
     using (var dlg = new LayerDialog(layer, new RasterCategoryControl()))
     {
         ShowDialog(dlg);
     }
 }
        /// <summary>
        /// This should launch a frmRasterSymbolizer
        /// </summary>
        /// <param name="context">ITypeDescriptorContext context</param>
        /// <param name="provider">IServiceProvider provider</param>
        /// <param name="value">object value</param>
        /// <returns>A new RasterSymbolizer</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IRasterSymbolizer rs = value as IRasterSymbolizer ?? new RasterSymbolizer();

            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            IRasterLayer parent = rs.ParentLayer;
            LayerDialog frm = new LayerDialog(parent, new RasterCategoryControl());
            dialogProvider.ShowDialog(frm);
            return parent.Symbolizer;
        }
        /// <summary>
        /// This should launch a frmRasterSymbolizer
        /// </summary>
        /// <param name="context">ITypeDescriptorContext context</param>
        /// <param name="provider">IServiceProvider provider</param>
        /// <param name="value">object value</param>
        /// <returns>A new RasterSymbolizer</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IRasterSymbolizer rs = value as IRasterSymbolizer ?? new RasterSymbolizer();

            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            IRasterLayer parent = rs.ParentLayer;
            LayerDialog  frm    = new LayerDialog(parent, new RasterCategoryControl());

            dialogProvider.ShowDialog(frm);
            return(parent.Symbolizer);
        }
Пример #8
0
 /// <summary>
 /// Show the properties of an image layer in the legend.
 /// </summary>
 /// <param name="layer">The image layer.</param>
 public void ShowProperties(IImageLayer layer)
 {
     using var dlg = new LayerDialog(layer, new ImageCategoryControl());
     ShowDialog(dlg);
 }
Пример #9
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)
         {
             LayerDialog layDialog = new LayerDialog(fl, new FeatureCategoryControl());
             layDialog.ShowDialog();
         }
         IRasterLayer rl = lb.Item as IRasterLayer;
         if (rl != null)
         {
             LayerDialog dlg = new 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);
 }
 /// <summary>
 /// This method is virtual, allowing a differnet custom behavior to override this default behavior
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void OnShowPropertiesClicked(object sender, IFeatureLayer e)
 {
     LayerDialog dlg = new LayerDialog(e, new FeatureCategoryControl());
     dlg.ShowDialog();
 }
 private void Raster_PropertiesClicked(object sender, RasterLayerEventArgs e)
 {
     LayerDialog dlg = new LayerDialog(e.RasterLayer, new RasterCategoryControl());
     dlg.ShowDialog(Owner);
 }
Пример #12
0
        /// <summary>
        /// This method is virtual, allowing a differnet custom behavior to override this default behavior
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void OnShowPropertiesClicked(object sender, IFeatureLayer e)
        {
            LayerDialog dlg = new LayerDialog(e, new FeatureCategoryControl());

            dlg.ShowDialog();
        }
        private void Raster_PropertiesClicked(object sender, RasterLayerEventArgs e)
        {
            LayerDialog dlg = new LayerDialog(e.RasterLayer, new RasterCategoryControl());

            dlg.ShowDialog(Owner);
        }