Esempio n. 1
0
 public MoveToolChanges(IEnumerable <KeyValuePair <string, object> > drawingSettingsValues, MoveToolPixelSource pixelSource, ISurface <ColorBgra> bitmapSource, bool leaveCopyBehind, RectDouble baseBounds, Matrix3x2Double baseTransform, Matrix3x2Double deltaTransform, TransformEditingMode editingMode, Matrix3x2Double editTransform, PointDouble?rotationAnchorOffset) : base(drawingSettingsValues)
 {
     if (((pixelSource == MoveToolPixelSource.Bitmap) && (bitmapSource == null)) || ((pixelSource != MoveToolPixelSource.Bitmap) && (bitmapSource != null)))
     {
         ExceptionUtil.ThrowArgumentException($"MoveToolPixelSource.{pixelSource} specified, but bitmapSourcePersistenceKey={this.bitmapSourcePersistenceKey}");
     }
     if (bitmapSource == null)
     {
         this.bitmapSourcePO             = null;
         this.bitmapSourcePersistenceKey = Guid.Empty;
     }
     else
     {
         this.bitmapSourcePO             = new PersistedObject <ISurface <ColorBgra> >(bitmapSource, true);
         this.bitmapSourcePersistenceKey = PersistedObjectLocker.Add <ISurface <ColorBgra> >(this.bitmapSourcePO);
     }
     this.pixelSource          = pixelSource;
     this.leaveCopyBehind      = leaveCopyBehind;
     this.baseBounds           = baseBounds;
     this.baseTransform        = baseTransform;
     this.deltaTransform       = deltaTransform;
     this.editingMode          = editingMode;
     this.editTransform        = editTransform;
     this.rotationAnchorOffset = rotationAnchorOffset;
     this.Initialize();
 }
Esempio n. 2
0
 public MoveToolChanges(IEnumerable <KeyValuePair <string, object> > drawingSettingsValues, MoveToolPixelSource pixelSource, Guid bitmapSourcePersistenceKey, bool leaveCopyBehind, RectDouble baseBounds, Matrix3x2Double baseTransform, Matrix3x2Double deltaTransform, TransformEditingMode editingMode, Matrix3x2Double editTransform, PointDouble?rotationAnchorOffset) : base(drawingSettingsValues)
 {
     if (((pixelSource == MoveToolPixelSource.Bitmap) && (bitmapSourcePersistenceKey == Guid.Empty)) || ((pixelSource != MoveToolPixelSource.Bitmap) && (bitmapSourcePersistenceKey != Guid.Empty)))
     {
         ExceptionUtil.ThrowArgumentException($"MoveToolPixelSource.{pixelSource} specified, but bitmapSourcePersistenceKey={bitmapSourcePersistenceKey}");
     }
     this.pixelSource = pixelSource;
     this.bitmapSourcePersistenceKey = bitmapSourcePersistenceKey;
     this.leaveCopyBehind            = leaveCopyBehind;
     this.baseBounds           = baseBounds;
     this.baseTransform        = baseTransform;
     this.deltaTransform       = deltaTransform;
     this.editingMode          = editingMode;
     this.editTransform        = editTransform;
     this.rotationAnchorOffset = rotationAnchorOffset;
     this.Initialize();
 }