/// <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(); } }
/// <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); } }
/// <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); } }
/// <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; } }