public bool Execute() { if (this.layerType == LayerType.PointCanvas) { this.shpInfo = mainControler.LayerManager.addTransportPointPoint( x, y, absoluteZoom); this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; mainControler.MapPanel.Invalidate(); } else { if (this.layerType == LayerType.PolylineCanvas) { if (bEditingStarted) { this.indexAddedPoint = mainControler.LayerManager.addTransportPolylinePoint(x, y); this.shpInfo = mainControler.LayerManager.getDrawShapeInformation(); } else { this.shpInfo = mainControler.LayerManager.addTransportPolyline(x, y); this.indexAddedPoint = 0; this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; } } if (this.layerType == LayerType.PolygonCanvas) { if (bEditingStarted) { // if (disposable) disposable = false; this.indexAddedPoint = mainControler.LayerManager.addTransportPolygonPoint(x, y); this.shpInfo = mainControler.LayerManager.getDrawShapeInformation(); } else { this.shpInfo = mainControler.LayerManager.addTransportPolygon(x, y); this.indexAddedPoint = 0; this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; } } if (bEditingStarted) { mainControler.LayerManager.setDrawShapeInformation(DrawShapeInformation.EditStoppedUndone, shpInfo, layerType); } else { mainControler.LayerManager.setDrawShapeInformation(DrawShapeInformation.EditStarted, shpInfo, layerType); } } OnShapeAdded(); return(true); }
public bool Execute() { if (this.layerType == LayerType.PointCanvas) { this.shpInfo = mainControler.LayerManager.addTransportPointPoint( x, y, absoluteZoom); this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; mainControler.MapPanel.Invalidate(); } else { if (this.layerType == LayerType.PolylineCanvas) { if (bEditingStarted) { this.indexAddedPoint = mainControler.LayerManager.addTransportPolylinePoint(x, y); this.shpInfo = mainControler.LayerManager.getDrawShapeInformation(); } else { this.shpInfo = mainControler.LayerManager.addTransportPolyline(x, y); this.indexAddedPoint = 0; this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; } } if (this.layerType == LayerType.PolygonCanvas) { if (bEditingStarted) { // if (disposable) disposable = false; this.indexAddedPoint = mainControler.LayerManager.addTransportPolygonPoint(x, y); this.shpInfo = mainControler.LayerManager.getDrawShapeInformation(); } else { this.shpInfo = mainControler.LayerManager.addTransportPolygon(x, y); this.indexAddedPoint = 0; this.shpInfo.iShapeInf.Category = Category; this.shpInfo.iShapeInf.Commment = Comment; } } if (bEditingStarted) mainControler.LayerManager.setDrawShapeInformation(DrawShapeInformation.EditStoppedUndone, shpInfo, layerType); else mainControler.LayerManager.setDrawShapeInformation(DrawShapeInformation.EditStarted, shpInfo, layerType); } OnShapeAdded(); return true; }