Beispiel #1
0
        public static bool IsVisible(IAnnotationLayout layout, bool checkAnnotationBoxVisibility)
        {
            var visible = layout.Visible;

            if (!visible || !checkAnnotationBoxVisibility)
            {
                return(visible);
            }

            bool atLeastOne       = false;
            bool allForcedVisible = true;

            foreach (var annotationBox in layout.AnnotationBoxes)
            {
                atLeastOne = true;
                if (annotationBox.VisibleInternal)
                {
                    return(true);
                }
                if (!annotationBox.AlwaysVisible)
                {
                    allForcedVisible = false;
                }
            }

            return(atLeastOne && allForcedVisible);
        }
Beispiel #2
0
        /// <summary>
        /// Draws the Text Overlay.
        /// </summary>
        protected void DrawTextOverlay(IPresentationImage presentationImage)
        {
            CodeClock clock = new CodeClock();

            clock.Start();

            if (presentationImage == null || !(presentationImage is IAnnotationLayoutProvider))
            {
                return;
            }

            IAnnotationLayout layout = ((IAnnotationLayoutProvider)presentationImage).AnnotationLayout;

            if (layout == null || !layout.Visible)
            {
                return;
            }

            foreach (AnnotationBox annotationBox in layout.AnnotationBoxes)
            {
                if (annotationBox.Visible)
                {
                    string annotationText = annotationBox.GetAnnotationText(presentationImage);
                    if (!String.IsNullOrEmpty(annotationText))
                    {
                        DrawAnnotationBox(annotationText, annotationBox);
                    }
                }
            }

            clock.Stop();
            PerformanceReportBroker.PublishReport("RendererBase", "DrawTextOverlay", clock.Seconds);
        }
Beispiel #3
0
 public TextOverlayVisibilityHelper(IAnnotationLayout annotationLayout)
 {
     _layout = annotationLayout;
     if (_layout != null)
     {
         _visible = _layout.Visible;
     }
 }
 private static void ShowAnnotation(IPresentationImage image)
 {
     if (image is IAnnotationLayoutProvider)
     {
         IAnnotationLayout annotationLayout = ((IAnnotationLayoutProvider)image).AnnotationLayout;
         if (annotationLayout != null)
         {
             annotationLayout.Visible = true;
         }
     }
 }
 public static void DrawTextOverlay(System.Drawing.Graphics g, Rectangle destination, IPresentationImage presentationImage)
 {
     if ((presentationImage != null) && (presentationImage is IAnnotationLayoutProvider))
     {
         IAnnotationLayout annotationLayout = ((IAnnotationLayoutProvider)presentationImage).AnnotationLayout;
         if (annotationLayout != null)
         {
             foreach (AnnotationBox box in annotationLayout.AnnotationBoxes)
             {
                 if (box.Visible)
                 {
                     string annotationText = box.GetAnnotationText(presentationImage);
                     if (!string.IsNullOrEmpty(annotationText))
                     {
                         DrawAnnotationBox(g, destination, annotationText, box);
                     }
                 }
             }
         }
     }
 }
		public static bool IsVisible(IAnnotationLayout layout, bool checkAnnotationBoxVisibility)
		{
			var visible = layout.Visible;
			if (!visible || !checkAnnotationBoxVisibility)
				return visible;

			bool atLeastOne = false;
			bool allForcedVisible = true;
			foreach (var annotationBox in layout.AnnotationBoxes)
			{
				atLeastOne = true;
				if (annotationBox.VisibleInternal)
					return true;
				if (!annotationBox.AlwaysVisible)
					allForcedVisible = false;
			}

			return atLeastOne && allForcedVisible;
		}
		public TextOverlayVisibilityHelper(IAnnotationLayout annotationLayout)
		{
			_layout = annotationLayout;
			if (_layout != null)
				_visible = _layout.Visible;
		}
Beispiel #8
0
 private StoredAnnotationLayoutProxy(StoredAnnotationLayoutProxy source, ICloningContext context)
 {
     _layoutId   = source._layoutId;
     _visible    = source.Visible;
     _realLayout = source._realLayout == null ? null : source._realLayout.Clone();
 }
			private StoredAnnotationLayoutProxy(StoredAnnotationLayoutProxy source, ICloningContext context)
			{
				_layoutId = source._layoutId;
				_visible = source.Visible;
				_realLayout = source._realLayout == null ? null : source._realLayout.Clone();
			}