//public void UpdateLabels(VectorLayer aLayer)
        //{
        //    aLayer.ClearLabels();
        //    ArrayList shapeList = new ArrayList();
        //    shapeList = (ArrayList)aLayer.ShapeList.Clone();
        //    int shapeIdx = 0;
        //    PointF aPoint = new PointF();

        //    switch (aLayer.ShapeType)
        //    {
        //        case ShapeTypes.Point:
        //            foreach (PointShape aPS in shapeList)
        //            {
        //                LabelPoint aLP = new LabelPoint();
        //                aPoint.X = (Single)aPS.Point.X;
        //                aPoint.Y = (Single)aPS.Point.Y;
        //                aLP.PointPos = aPoint;
        //                aLP.Text = aLayer.GetCellValue(aLayer.LabelSetV.FieldName, shapeIdx).ToString();
        //                aLayer.AddLabel(aLP);
        //                shapeIdx += 1;
        //            }
        //            break;
        //        case ShapeTypes.Polygon:
        //            foreach (PolygonShape aPGS in shapeList)
        //            {
        //                LabelPoint aLP = new LabelPoint();
        //                Extent aExtent = aPGS.extent;
        //                aPoint.X = (Single)((aExtent.minX + aExtent.maxX) / 2);
        //                aPoint.Y = (Single)((aExtent.minY + aExtent.maxY) / 2);
        //                aLP.PointPos = aPoint;
        //                aLP.Text = aLayer.GetCellValue(aLayer.LabelSetV.FieldName, (int)aPGS.lowValue).ToString();
        //                aLayer.AddLabel(aLP);
        //                shapeIdx += 1;
        //            }
        //            break;
        //        case ShapeTypes.Polyline:
        //            foreach (PolylineShape aPLS in shapeList)
        //            {
        //                LabelPoint aLP = new LabelPoint();
        //                int pIdx = aPLS.points.Count / 2;
        //                //Single angle = (Single)(Math.Atan((((wContour.Contour.Point)aPLS.points[pIdx]).y - ((wContour.Contour.Point)aPLS.points[pIdx - 1]).y) /
        //                    //(((wContour.Contour.Point)aPLS.points[pIdx]).x - ((wContour.Contour.Point)aPLS.points[pIdx - 1]).x)) * 180 / Math.PI);
        //                aPoint.X = (Single)((wContour.Point)aPLS.points[pIdx - 1]).X;
        //                aPoint.Y = (Single)((wContour.Point)aPLS.points[pIdx - 1]).Y;
        //                aLP.PointPos = aPoint;
        //                //aLP.Angle = angle;
        //                aLP.Text = aLayer.GetCellValue(aLayer.LabelSetV.FieldName, (int)aPLS.value).ToString();
        //                aLayer.AddLabel(aLP);
        //                shapeIdx += 1;
        //            }
        //            break;
        //    }

        //    frmMain.G_LayersLegend.ActiveMapFrame.MapView.PaintLayers();
        //}

        private void B_DrawLabels_Click(object sender, EventArgs e)
        {
            _layer.RemoveLabels();
            UpdateLabelSet();
            AddLabels();

            _mapView.PaintLayers();
        }