Пример #1
0
        /// <summary>
        /// Shows the 'Symbol Details' dialog
        /// </summary>
        private void ShowDetailsDialog()
        {
            DetailedLineSymbolDialog detailsDialog = new DetailedLineSymbolDialog(_original);

            detailsDialog.ChangesApplied += DetailsDialogChangesApplied;
            detailsDialog.ShowDialog();
        }
Пример #2
0
 /// <summary>
 /// Creates a new instance of PointSizeRangeControl
 /// </summary>
 public FeatureSizeRangeControl()
 {
     InitializeComponent();
     _pointDialog = new DetailedPointSymbolDialog();
     _pointDialog.ChangesApplied += _pointDialog_ChangesApplied;
     _lineDialog = new DetailedLineSymbolDialog();
     _lineDialog.ChangesApplied += _lineDialog_ChangesApplied;
 }
 /// <summary>
 /// Creates a new instance of PointSizeRangeControl
 /// </summary>
 public FeatureSizeRangeControl()
 {
     InitializeComponent();
     _pointDialog = new DetailedPointSymbolDialog();
     _pointDialog.ChangesApplied += _pointDialog_ChangesApplied;
     _lineDialog = new DetailedLineSymbolDialog();
     _lineDialog.ChangesApplied += _lineDialog_ChangesApplied;
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FeatureSizeRangeControl"/> class.
        /// </summary>
        public FeatureSizeRangeControl()
        {
            InitializeComponent();
            _featSizeCulture = new CultureInfo(string.Empty);

            _pointDialog = new DetailedPointSymbolDialog();
            _pointDialog.ChangesApplied += PointDialogChangesApplied;
            _lineDialog = new DetailedLineSymbolDialog();
            _lineDialog.ChangesApplied += LineDialogChangesApplied;
        }
Пример #5
0
 /// <summary>
 /// Launches a form for editing the line symbolizer
 /// </summary>
 /// <param name="context"></param>
 /// <param name="provider"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     _original = context.Instance as ILineSymbolizer;
     IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     _editCopy = _original.Copy();
     DetailedLineSymbolDialog dialog = new DetailedLineSymbolDialog(_editCopy);
     dialog.ChangesApplied += DialogChangesApplied;
     if (_original != null)
         return dialogProvider.ShowDialog(dialog) != DialogResult.OK ? _original.Strokes : _editCopy.Strokes;
     return null;
 }
Пример #6
0
 /// <summary>
 /// Launches a form for editing the line symbolizer
 /// </summary>
 /// <param name="context"></param>
 /// <param name="provider"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     _original = value as ILineSymbolizer;
     if (_original == null) return value;
     _copy = _original.Copy();
     IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     DetailedLineSymbolDialog dialog = new DetailedLineSymbolDialog(_copy);
     dialog.ChangesApplied += DialogChangesApplied;
     if (dialogProvider.ShowDialog(dialog) != DialogResult.OK) return _original;
     _original.CopyProperties(_copy);
     return value;
 }
Пример #7
0
        /// <summary>
        /// Launches a form for editing the line symbolizer
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _original = context.Instance as ILineSymbolizer;
            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            _editCopy = _original.Copy();
            DetailedLineSymbolDialog dialog = new DetailedLineSymbolDialog(_editCopy);

            dialog.ChangesApplied += DialogChangesApplied;
            if (_original != null)
            {
                return(dialogProvider.ShowDialog(dialog) != DialogResult.OK ? _original.Strokes : _editCopy.Strokes);
            }
            return(null);
        }
Пример #8
0
        /// <summary>
        /// Launches a form for editing the line symbolizer
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _original = value as ILineSymbolizer;
            if (_original == null)
            {
                return(value);
            }
            _copy = _original.Copy();
            IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            DetailedLineSymbolDialog   dialog         = new DetailedLineSymbolDialog(_copy);

            dialog.ChangesApplied += DialogChangesApplied;
            if (dialogProvider.ShowDialog(dialog) != DialogResult.OK)
            {
                return(_original);
            }
            _original.CopyProperties(_copy);
            return(value);
        }
Пример #9
0
        private void btnEditOutline_Click(object sender, EventArgs e)
        {
            DetailedLineSymbolDialog dlg;

            if (_original != null)
            {
                dlg = new DetailedLineSymbolDialog(_pattern.Outline);
            }
            else if (_pattern != null)
            {
                dlg = new DetailedLineSymbolDialog(_pattern.Outline);
            }
            else
            {
                return;
            }
            dlg.ChangesApplied += DlgChangesApplied;
            dlg.ShowDialog();
        }
Пример #10
0
 private void btnEditOutline_Click(object sender, EventArgs e)
 {
     DetailedLineSymbolDialog dlg;
     if (_original != null)
     {
         dlg = new DetailedLineSymbolDialog(_pattern.Outline);
     }
     else if (_pattern != null)
     {
         dlg = new DetailedLineSymbolDialog(_pattern.Outline);
     }
     else
     {
         return;
     }
     dlg.ChangesApplied += DlgChangesApplied;
     dlg.ShowDialog();
 }
 /// <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.GetCategories().Count();
     if (e.ColumnIndex == 0 && e.RowIndex < count)
     {
         if (_schemeType == SymbolizerType.Point)
         {
             IPointScheme ps = _newScheme as IPointScheme;
             if (ps != null)
             {
                 IPointSymbolizer pointSym = ps.Categories[e.RowIndex].Symbolizer;
                 DetailedPointSymbolDialog dlg = new DetailedPointSymbolDialog(pointSym);
                 dlg.ShowDialog();
                 IPointSymbolizer selPoint = pointSym.Copy();
                 selPoint.SetFillColor(Color.Cyan);
                 ps.Categories[e.RowIndex].SelectionSymbolizer = selPoint;
             }
         }
         else if (_schemeType == SymbolizerType.Line)
         {
             ILineScheme ls = _newScheme as ILineScheme;
             if (ls != null)
             {
                 ILineSymbolizer lineSym = ls.Categories[e.RowIndex].Symbolizer;
                 DetailedLineSymbolDialog dlg = new DetailedLineSymbolDialog(lineSym);
                 dlg.ShowDialog();
                 ILineSymbolizer selLine = lineSym.Copy();
                 selLine.SetFillColor(Color.Cyan);
                 ls.Categories[e.RowIndex].SelectionSymbolizer = selLine;
             }
         }
         else if (_schemeType == SymbolizerType.Polygon)
         {
             IPolygonScheme ps = _newScheme as IPolygonScheme;
             if (ps != null)
             {
                 IPolygonSymbolizer polySym = ps.Categories[e.RowIndex].Symbolizer;
                 DetailedPolygonSymbolDialog dlg = new DetailedPolygonSymbolDialog(polySym);
                 dlg.ShowDialog();
                 IPolygonSymbolizer selPoly = polySym.Copy();
                 selPoly.SetFillColor(Color.Cyan);
                 selPoly.OutlineSymbolizer.SetFillColor(Color.DarkCyan);
                 ps.Categories[e.RowIndex].SelectionSymbolizer = selPoly;
             }
         }
     }
     else if (e.ColumnIndex == 1 && e.RowIndex < count)
     {
         if (_newScheme.EditorSettings.ClassificationType != ClassificationType.Custom)
         {
             MessageBox.Show(SymbologyFormsMessageStrings.FeatureCategoryControl_CustomOnly);
             return;
         }
         _expressionIsExclude = false;
         List<IFeatureCategory> cats = _newScheme.GetCategories().ToList();
         _expressionDialog.Expression = cats[e.RowIndex].FilterExpression;
         _expressionDialog.ShowDialog(this);
     }
 }
Пример #12
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);
 }
Пример #13
0
 /// <summary>
 /// Shows the 'Symbol Details' dialog
 /// </summary>
 private void ShowDetailsDialog()
 {
     DetailedLineSymbolDialog detailsDialog = new DetailedLineSymbolDialog(_original);
     detailsDialog.ChangesApplied += detailsDialog_ChangesApplied;
     detailsDialog.ShowDialog();
 }