public bool HandleGroupOperation(EditorCommand command)
        {
            switch (command)
            {
            case EditorCommand.Copy:
                _geoService.CopyShapes();
                return(true);

            case EditorCommand.Paste:
                _geoService.PasteShapes();
                return(true);

            case EditorCommand.Cut:
                _geoService.CutShapes();
                return(true);

            case EditorCommand.SplitShapes:
                _geoService.ExplodeShapes();
                return(true);

            case EditorCommand.MergeShapes:
                _geoService.MergeShapes();
                return(true);

            case EditorCommand.RemoveShapes:
                _geoService.RemoveSelectedShapes(true);
                return(true);
            }
            return(false);
        }
Exemple #2
0
        public bool HandleGroupOperation(string itemKey)
        {
            switch (itemKey)
            {
            case MenuKeys.MergeShapes:
                _geoprocessingService.MergeShapes();
                return(true);

            case MenuKeys.Copy:
                _geoprocessingService.CopyShapes();
                return(true);

            case MenuKeys.Paste:
                _geoprocessingService.PasteShapes();
                return(true);

            case MenuKeys.Cut:
                _geoprocessingService.CutShapes();
                return(true);

            case MenuKeys.SplitShapes:
                _geoprocessingService.ExplodeShapes();
                return(true);

            case MenuKeys.DeleteSelected:
            case MenuKeys.RemoveShapes:
                _geoprocessingService.RemoveSelectedShapes(true);
                return(true);
            }
            return(false);
        }
Exemple #3
0
        public bool Cut(int layerHandle, IFeatureSet fs)
        {
            if (fs == null || fs.NumSelected == 0)
            {
                return(false);
            }

            PopulateBuffer(fs);

            _geoService.RemoveSelectedShapes(layerHandle, false);
            return(true);
        }
Exemple #4
0
        private void Plugin_ItemClicked(object sender, MenuItemEventArgs e)
        {
            if (HandleGroupOperation(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            if (HandleMapCursorChange(e.ItemKey))
            {
                _context.View.Update();
                return;
            }

            switch (e.ItemKey)
            {
            case MenuKeys.DeleteSelected:
                _geoprocessingService.RemoveSelectedShapes(true);
                break;

            case MenuKeys.CreateLayer:
                _layerService.CreateLayer();
                break;

            case MenuKeys.LayerEdit:
                _layerService.ToggleVectorLayerEditing();
                break;

            case MenuKeys.Undo:
                _context.Map.History.Undo();
                _context.Map.Redraw(RedrawType.SkipDataLayers);
                break;

            case MenuKeys.Redo:
                _context.Map.History.Redo();
                _context.Map.Redraw(RedrawType.SkipDataLayers);
                break;
            }
            _context.View.Update();
        }