RedoableWorker 的一些扩展

This commit is contained in:
龙腾猫跃 committed 2026-06-28 08:33:49 +08:00
1 parent be802ede2e
commit 8b26dccd22
2 files changed
+41 -9

No files matched your search

+12
View File
@@ -62,6 +62,18 @@ public class ProgressProvider {
public void Finish(ChildrenAction action = ChildrenAction.Finished) => Set(1, skiped: false, action: action);
/// <summary>跳过当前项的剩余进度。</summary>
public void Skip(ChildrenAction action = ChildrenAction.Skiped) => Set(1, skiped: true, action: action);
/// <summary>
/// 重置当前进度,并清除所有子项。
/// </summary>
public void Reset() {
bool changed;
lock (this) {
changed = progressSum > 0;
progressParts = (0, 0, 0);
childrens.Clear();
}
if (changed) InvokeProgressChanged();
}
// ===================================== 子项进度 =====================================