diff --git a/App.xaml.cs b/App.xaml.cs index f0b8d09..2c5eb49 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -221,24 +221,27 @@ namespace DrillTools using var writer = new StreamWriter(filePath, false, Encoding.GetEncoding(936)); writer.Write(scaledContent); - System.Windows.MessageBox.Show( - $"涨缩完成,原文件已备份为:\n{Path.GetFileName(filePath)}.bak", - "涨缩完成", - MessageBoxButton.OK, - MessageBoxImage.Information); - - // 系数记忆:将本次模式与原始输入连同源文件名写入 ini,供下次载入。 - // 属辅助功能,失败不回滚已完成的涨缩,单独提示。 + // 系数记忆:紧跟钻带写回立即落盘,不滞后到完成提示之后。 + // 属辅助功能,失败不回滚已完成的涨缩,失败原因随完成提示一并告知。 + string? memoryWarning = null; try { ScalingProfileStore.Save(result.Mode, result.InputX, result.InputY, Path.GetFileName(filePath)); } catch (Exception ex) { - System.Windows.MessageBox.Show( - $"系数记忆保存失败:\n{ex.Message}\n本次涨缩已完成,不影响结果。", - "系数记忆", MessageBoxButton.OK, MessageBoxImage.Warning); + memoryWarning = $"\n(系数记忆保存失败:{ex.Message})"; } + + string completionMessage = $"涨缩完成,原文件已备份为:\n{Path.GetFileName(filePath)}.bak"; + if (memoryWarning != null) + completionMessage += memoryWarning; + + System.Windows.MessageBox.Show( + completionMessage, + "涨缩完成", + MessageBoxButton.OK, + MessageBoxImage.Information); } catch (Exception ex) {