public SelectionGeometryCache(IDirect2DFactory factory, PaintDotNet.Canvas.SelectionSnapshot selectionSnapshot)
 {
     this.factory           = factory;
     this.selectionSnapshot = selectionSnapshot;
     this.geometry          = LazyResult.New <IGeometry>(() => this.factory.CreateGeometry(selectionSnapshot.GeometryList.Value), LazyThreadSafetyMode.ExecutionAndPublication, new SingleUseCriticalSection());
     this.pixelatedGeometry = LazyResult.New <IGeometry>(() => GeometryHelpers.ToDirect2DGeometryDestructive(this.factory, ScansHelpers.ConvertNonOverlappingScansToPolygons(selectionSnapshot.PixelatedScans.Value), FillMode.Alternate, FigureBegin.Filled, FigureEnd.Closed), LazyThreadSafetyMode.ExecutionAndPublication, new SingleUseCriticalSection());
 }
 public SelectionRenderParameters(PaintDotNet.Canvas.SelectionSnapshot selectionSnapshot, SizeDouble canvasSize, SizeDouble viewportSize, RectDouble viewportCanvasBounds, double scaleRatio, bool isInteriorFilled, Brush interiorBrush, bool isOutlineEnabled, bool isOutlineAntialiased, bool isOutlineAnimated, PaintDotNet.SelectionRenderingQuality selectionRenderingQuality)
 {
     this.SelectionSnapshot         = selectionSnapshot;
     this.CanvasSize                = canvasSize;
     this.ViewportSize              = viewportSize;
     this.ViewportCanvasBounds      = viewportCanvasBounds;
     this.ScaleRatio                = scaleRatio;
     this.IsInteriorFilled          = isInteriorFilled;
     this.InteriorBrush             = interiorBrush;
     this.IsOutlineEnabled          = isOutlineEnabled;
     this.IsOutlineAntialiased      = isOutlineAntialiased;
     this.IsOutlineAnimated         = isOutlineAnimated;
     this.SelectionRenderingQuality = selectionRenderingQuality;
 }
 protected override void Dispose(bool disposing)
 {
     this.selectionSnapshot = null;
     if (disposing)
     {
         LazyResult <IGeometry> geometry = this.geometry;
         this.geometry = null;
         if ((geometry != null) && geometry.IsEvaluated)
         {
             geometry.Value.Dispose();
         }
         LazyResult <IGeometry> pixelatedGeometry = this.pixelatedGeometry;
         this.pixelatedGeometry = null;
         if ((pixelatedGeometry != null) && pixelatedGeometry.IsEvaluated)
         {
             pixelatedGeometry.Value.Dispose();
         }
     }
     base.Dispose(disposing);
 }