Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UVtools.Core/Operations/OperationLayerClone.cs')
-rw-r--r--UVtools.Core/Operations/OperationLayerClone.cs18
1 files changed, 12 insertions, 6 deletions
diff --git a/UVtools.Core/Operations/OperationLayerClone.cs b/UVtools.Core/Operations/OperationLayerClone.cs
index 5ec7c28..9eca95c 100644
--- a/UVtools.Core/Operations/OperationLayerClone.cs
+++ b/UVtools.Core/Operations/OperationLayerClone.cs
@@ -76,11 +76,19 @@ namespace UVtools.Core.Operations
#endregion
+ #region Constructor
+
+ public OperationLayerClone() { }
+
+ public OperationLayerClone(FileFormat slicerFile) : base(slicerFile) { }
+
+ #endregion
+
#region Methods
- public override bool Execute(FileFormat slicerFile, OperationProgress progress = null)
+ protected override bool ExecuteInternally(OperationProgress progress)
{
- var oldLayers = slicerFile.LayerManager.Layers;
+ var oldLayers = SlicerFile.LayerManager.Layers;
uint totalClones = (LayerIndexEnd - LayerIndexStart + 1) * Clones;
uint newLayerCount = (uint) (oldLayers.Length + totalClones);
@@ -107,11 +115,9 @@ namespace UVtools.Core.Operations
newLayerIndex++;
}
- slicerFile.LayerManager.Layers = layers;
-
- progress.Token.ThrowIfCancellationRequested();
+ SlicerFile.LayerManager.Layers = layers;
- return true;
+ return !progress.Token.IsCancellationRequested;
}
#endregion