private void readyButton_Click(object sender, EventArgs e) { if (!screenIsLocked) { if (mapPanel.SelectedTool == Tool.DrawPolyline) { mainControler.PerformAction(new FinishDrawingAction(LayerType.PolylineCanvas, mainControler.LayerManager)); } else if (mapPanel.SelectedTool == Tool.DrawPolygon) { mainControler.PerformAction(new FinishDrawingAction(LayerType.PolygonCanvas, mainControler.LayerManager)); } } }