Exemplo n.º 1
0
        /// <summary>
        /// Returns the bounding box occupied by the content
        /// </summary>
        /// <returns>
        /// Bounding box occupied by the content
        /// </returns>
        public Rect GetContentBounds(BoundsDrawingContextWalker ctx)
        {
            Debug.Assert(ctx != null);

            DrawingContextWalk(ctx);
            return(ctx.Bounds);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the bounding box occupied by the content
        /// </summary>
        /// <returns>
        /// Bounding box occupied by the content
        /// </returns>
        Rect IDrawingContent.GetContentBounds(BoundsDrawingContextWalker ctx)
        {
            Debug.Assert(ctx != null);

            WalkCurrentValue(ctx);

            return(ctx.Bounds);
        }
Exemplo n.º 3
0
        /// <summary>
        /// GetBounds to calculate the bounds of this drawing.
        /// </summary>
        internal Rect GetBounds()
        {
            BoundsDrawingContextWalker ctx = new BoundsDrawingContextWalker();

            WalkCurrentValue(ctx);

            return(ctx.Bounds);
        }
        /// <summary>
        /// Returns the bounding box of the content.
        /// </summary>
        internal override Rect GetContentBounds()
        {
            if (_content != null)
            {
                Rect         resultRect        = Rect.Empty;
                MediaContext mediaContext      = MediaContext.From(Dispatcher);
                BoundsDrawingContextWalker ctx = mediaContext.AcquireBoundsDrawingContextWalker();

                resultRect = _content.GetContentBounds(ctx);
                mediaContext.ReleaseBoundsDrawingContextWalker(ctx);

                return(resultRect);
            }
            else
            {
                return(Rect.Empty);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns the bounding box occupied by the content
        /// </summary>
        /// <returns>
        /// Bounding box occupied by the content
        /// </returns>
        public Rect GetContentBounds(BoundsDrawingContextWalker ctx)
        {
            Debug.Assert(ctx != null);

            DrawingContextWalk(ctx);
            return ctx.Bounds;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Set the BoundsDrawingContextWalker for next use 
 /// To handle reentrance we want to make sure that 
 /// no one else on the same thread gets the same context.
 /// </summary> 
 internal void ReleaseBoundsDrawingContextWalker(BoundsDrawingContextWalker ctx)
 {
     _cachedBoundsDrawingContextWalker = ctx;
 } 
Exemplo n.º 7
0
 /// <summary>
 /// Returns the bounding box occupied by the content
 /// </summary>
 /// <returns>
 /// Bounding box occupied by the content
 /// </returns>
 Rect IDrawingContent.GetContentBounds(BoundsDrawingContextWalker ctx)
 {     
     Debug.Assert(ctx != null);        
     
     WalkCurrentValue(ctx);
     
     return ctx.Bounds;
 }
Exemplo n.º 8
0
        /// <summary>
        /// GetBounds to calculate the bounds of this drawing.
        /// </summary>               
        internal Rect GetBounds()
        {
            BoundsDrawingContextWalker ctx = new BoundsDrawingContextWalker();

            WalkCurrentValue(ctx);
        
            return ctx.Bounds;
        }