Exemplo n.º 1
0
        private static LabelPlace GetOpposite(LabelPlace place)
        {
            switch (place)
            {
            case LabelPlace.None:
                return(LabelPlace.None);

            case LabelPlace.Left:
                return(LabelPlace.Right);

            case LabelPlace.Top:
                return(LabelPlace.Bottom);

            case LabelPlace.Right:
                return(LabelPlace.Left);

            case LabelPlace.Bottom:
                return(LabelPlace.Top);
            }
            throw new ArgumentOutOfRangeException();
        }
Exemplo n.º 2
0
        private static LabelRect GetLabelRect(MapMarker marker, Point markerPosition, Size markerSize, Size labelSize, LabelPlace place)
        {
            switch (place)
            {
            case LabelPlace.None:
            case LabelPlace.Left:
                return(new LabelRect(marker, new Rect(markerPosition.X - markerSize.Width / 2 - labelSize.Width, markerPosition.Y - labelSize.Height / 2, labelSize.Width, labelSize.Height), place));

            case LabelPlace.Top:
                return(new LabelRect(marker, new Rect(markerPosition.X - labelSize.Width / 2, markerPosition.Y - labelSize.Height - markerSize.Height / 2, labelSize.Width, labelSize.Height), place));

            case LabelPlace.Right:
                return(new LabelRect(marker, new Rect(markerPosition.X + markerSize.Width / 2, markerPosition.Y - labelSize.Height / 2, labelSize.Width, labelSize.Height), place));

            case LabelPlace.Bottom:
                return(new LabelRect(marker, new Rect(markerPosition.X - labelSize.Width / 2, markerPosition.Y + markerSize.Height / 2, labelSize.Width, labelSize.Height), place));

            default:
                throw new ArgumentOutOfRangeException("place");
            }
        }
Exemplo n.º 3
0
 public LabelRect(MapMarker marker, Rect rect, LabelPlace place)
 {
     MapMarker = marker;
     Rect      = rect;
     Place     = place;
 }