예제 #1
0
        public virtual void Initialize(IControlGraphic graphic)
        {
            IsTileCoordinates = graphic.CoordinateSystem == CoordinateSystem.Destination;
            var annotationGraphic = graphic as AnnotationGraphic;

            if (annotationGraphic == null)
            {
                return;
            }

            Callout = new CalloutAnnotation();
            Callout.Initialize(annotationGraphic.Callout);
        }
예제 #2
0
        public static Annotation CreateFrom(IControlGraphic graphic)
        {
            if (EllipseAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new EllipseAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (RectangleAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new RectangleAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (RulerAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new RulerAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (PolygonAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new PolygonAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (ProtractorAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new ProtractorAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (CalloutAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new CalloutAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }
            if (TextAreaAnnotation.CanCreateFrom(graphic))
            {
                var annotation = new TextAreaAnnotation();
                annotation.Initialize(graphic);
                return(annotation);
            }

            return(null);
        }