private void AddShapeButton_Click(object sender, EventArgs e) { if (_geoMap == null) { return; } if (_geoMap.Layers.SelectedLayer != null) { _activeLayer = _geoMap.Layers.SelectedLayer as IFeatureLayer; } if (_activeLayer == null) { MessageBox.Show("请选中有效图层。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (_addShapeFunction == null) { _addShapeFunction = new AddShapeFunction(_geoMap) { Name = Resource.AddShape }; } if (_geoMap.MapFunctions.Contains(_addShapeFunction) == false) { _geoMap.MapFunctions.Add(_addShapeFunction); } _geoMap.FunctionMode = FunctionMode.None; _geoMap.Cursor = Cursors.Hand; UpdateAddShapeFunctionLayer(); _addShapeFunction.Activate(); }
private void AddShapeButton_Click(object sender, EventArgs e) { if (_geoMap == null) { return; } if (_geoMap.Layers.SelectedLayer != null) { _activeLayer = _geoMap.Layers.SelectedLayer as IFeatureLayer; } if (_activeLayer == null) { return; } if (_addShapeFunction == null) { _addShapeFunction = new AddShapeFunction(_geoMap) { Name = "AddShape" }; } if (_geoMap.MapFunctions.Contains(_addShapeFunction) == false) { _geoMap.MapFunctions.Add(_addShapeFunction); } _geoMap.FunctionMode = FunctionMode.None; _geoMap.Cursor = Cursors.Hand; UpdateAddShapeFunctionLayer(); _addShapeFunction.Activate(); }