示例#1
0
 /// <summary>
 /// Peels the specific shape.
 /// </summary>
 /// <param name="shape">The shape.</param>
 internal void PeelShape(DrawingShape shape)
 {
     Debug.Assert(shape != null);
     lock (renderSyncObject)
     {
         string statName = shape.GetType().Name.Replace("Shape", " count");
         UpdateStats(statName, -1);
         peelings.Push(shape);
         PeelShape(shape, drawingShapes);
         RefreshAll();
     }
 }
示例#2
0
 /// <summary>
 /// Adds the shape to the list and updates the render targets.
 /// </summary>
 /// <param name="shape">The shape.</param>
 /// <returns></returns>
 private DrawingShape AddShape(DrawingShape shape)
 {
     lock (renderSyncObject)
     {
         drawingShapes.Add(shape);
         string statName = shape.GetType().Name.Replace("Shape", " count");
         UpdateStats(statName, 1);
         if (UsingCompatibleRenderTarget)
         {
             AddToCompatibleRenderTarget(shape);
         }
         InvalidateClientRectangle();
         return(shape);
     }
 }
示例#3
0
 /// <summary>
 /// Puts a shape from the stack of peelings back to the list of shapes and invalidates the render targets.
 /// </summary>
 /// <returns></returns>
 internal DrawingShape UnpeelShape()
 {
     lock (renderSyncObject)
     {
         if (peelings.Count == 0)
         {
             return(null);
         }
         DrawingShape shape    = peelings.Peek();
         string       statName = shape.GetType().Name.Replace("Shape", " count");
         UpdateStats(statName, 1);
         drawingShapes.Add(peelings.Pop());
         if (UsingCompatibleRenderTarget)
         {
             AddToCompatibleRenderTarget(shape);
         }
         InvalidateClientRectangle();
         return(shape);
     }
 }
示例#4
0
 /// <summary>
 /// Adds the shape to the list and updates the render targets.
 /// </summary>
 /// <param name="shape">The shape.</param>
 /// <returns></returns>
 private DrawingShape AddShape(DrawingShape shape)
 {
     lock (renderSyncObject)
     {
         drawingShapes.Add(shape);
         string statName = shape.GetType().Name.Replace("Shape", " count");
         UpdateStats(statName, 1);
         if (UsingCompatibleRenderTarget)
             AddToCompatibleRenderTarget(shape);
         InvalidateClientRectangle();
         return shape;
     }
 }
示例#5
0
 /// <summary>
 /// Peels the specific shape.
 /// </summary>
 /// <param name="shape">The shape.</param>
 internal void PeelShape(DrawingShape shape)
 {
     Debug.Assert(shape != null);
     lock (renderSyncObject)
     {
         string statName = shape.GetType().Name.Replace("Shape", " count");
         UpdateStats(statName, -1);
         peelings.Push(shape);
         PeelShape(shape, drawingShapes);
         RefreshAll();
     }
 }