示例#1
0
        private object CheckBounds(Point currentPoint)
        {
            Annotation selectedAxisAnnotation = null, selectedPixelAnnotation = null;
            var        annotations = Annotations.Where(axis => axis.CoordinateUnit == CoordinateUnit.Axis).Where(annotation => annotation is TextAnnotation);

            if (annotations.Count() > 0)
            {
                foreach (Annotation annotation in annotations)
                {
                    if (annotation.RotatedRect.Contains(currentPoint))
                    {
                        selectedAxisAnnotation = annotation;
                    }
                }
            }

            annotations = Annotations.Where(pixel => pixel.CoordinateUnit == CoordinateUnit.Pixel).Where(annotation => annotation is TextAnnotation);
            if (annotations.Count() > 0)
            {
                foreach (Annotation annotation in annotations)
                {
                    if (annotation.RotatedRect.Contains(currentPoint))
                    {
                        selectedPixelAnnotation = annotation;
                    }
                }
            }

            return(selectedPixelAnnotation != null ? selectedPixelAnnotation : selectedAxisAnnotation);
        }