关闭配方编辑器时提示保存或不保存
This commit is contained in:
parent
11ed3fe891
commit
5d7fbaf869
@ -24,16 +24,16 @@ public partial class RecipeEditor : UserControl
|
||||
if (_host is not null) _host.Closing -= Closing;
|
||||
_host = null;
|
||||
UnbindRecording();
|
||||
if (_model is not null) { _model.PropertyChanged -= ModelChanged; _model.AgentChatMessages.CollectionChanged -= ChatChanged; _ = _model.ShutdownAsync(); }
|
||||
if (_model is not null) { _model.PropertyChanged -= ModelChanged; _model.AgentChatMessages.CollectionChanged -= ChatChanged; _model.ConfirmCloseAsync = null; _ = _model.ShutdownAsync(); }
|
||||
};
|
||||
}
|
||||
private void BindModel()
|
||||
{
|
||||
if (!ReferenceEquals(_model, DataContext))
|
||||
{
|
||||
if (_model is not null) { _model.PropertyChanged -= ModelChanged; _model.AgentChatMessages.CollectionChanged -= ChatChanged; }
|
||||
if (_model is not null) { _model.PropertyChanged -= ModelChanged; _model.AgentChatMessages.CollectionChanged -= ChatChanged; _model.ConfirmCloseAsync = null; }
|
||||
_model = DataContext as RecipeEditorViewModel;
|
||||
if (_model is not null) { _model.PropertyChanged += ModelChanged; _model.AgentChatMessages.CollectionChanged += ChatChanged; }
|
||||
if (_model is not null) { _model.PropertyChanged += ModelChanged; _model.AgentChatMessages.CollectionChanged += ChatChanged; _model.ConfirmCloseAsync ??= ConfirmSaveOnCloseAsync; }
|
||||
}
|
||||
BindRecording();
|
||||
}
|
||||
@ -96,15 +96,36 @@ public partial class RecipeEditor : UserControl
|
||||
}
|
||||
private async void Closing(object? sender, WindowClosingEventArgs e)
|
||||
{
|
||||
if (_closedSafely || _model?.SopRecording is null) return;
|
||||
if (_closing) { e.Cancel = true; return; }
|
||||
_closing = true; _dialog?.Close(false);
|
||||
var shutdown = _model.ShutdownAsync();
|
||||
// The Close command already awaited shutdown. Let Prism finish that close in one pass.
|
||||
if (shutdown.IsCompleted) { _closedSafely = true; return; }
|
||||
if (_closedSafely || _model is null) return;
|
||||
if (_model.CanCloseDialog()) { _closedSafely = true; return; }
|
||||
e.Cancel = true;
|
||||
await shutdown;
|
||||
_closedSafely = true;
|
||||
if (sender is Window host) Dispatcher.UIThread.Post(host.Close);
|
||||
if (_closing) { e.Cancel = true; return; }
|
||||
_closing = true;
|
||||
try
|
||||
{
|
||||
if (!await _model.PrepareCloseAsync()) return;
|
||||
_closedSafely = true;
|
||||
if (sender is Window host) Dispatcher.UIThread.Post(host.Close);
|
||||
}
|
||||
finally { _closing = false; }
|
||||
}
|
||||
|
||||
private async Task<RecipeCloseChoice> ConfirmSaveOnCloseAsync()
|
||||
{
|
||||
if (_dialog is not null || TopLevel.GetTopLevel(this) is not Window owner) return RecipeCloseChoice.Cancel;
|
||||
var dialog = new Window { Title = "保存配方", Width = 440, SizeToContent = SizeToContent.Height, CanResize = false,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner };
|
||||
var actions = new StackPanel { Orientation = Avalonia.Layout.Orientation.Horizontal,
|
||||
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right, Spacing = 8 };
|
||||
var save = new Button { Name = "SaveRecipeAndCloseButton", Content = "保存并关闭", IsDefault = true };
|
||||
var discard = new Button { Name = "DiscardRecipeAndCloseButton", Content = "不保存" };
|
||||
save.Click += (_, _) => dialog.Close(RecipeCloseChoice.Save);
|
||||
discard.Click += (_, _) => dialog.Close(RecipeCloseChoice.Discard);
|
||||
actions.Children.Add(save); actions.Children.Add(discard);
|
||||
dialog.Content = new StackPanel { Margin = new Avalonia.Thickness(20), Spacing = 18,
|
||||
Children = { new TextBlock { Text = "关闭编辑窗口前,是否保存当前配方修改?", TextWrapping = Avalonia.Media.TextWrapping.Wrap }, actions } };
|
||||
_dialog = dialog;
|
||||
try { return await dialog.ShowDialog<RecipeCloseChoice>(owner); }
|
||||
finally { _dialog = null; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
private readonly HashSet<EditorNode> _observedStepNodes = [];
|
||||
private string _saveStatus = "";
|
||||
private bool _closingDialog;
|
||||
private bool _closeApproved;
|
||||
public Func<Task<RecipeCloseChoice>>? ConfirmCloseAsync { get; set; }
|
||||
public string SaveStatus { get => _saveStatus; private set => SetProperty(ref _saveStatus, value); }
|
||||
public string NameValidationMessage => RecipeWorkspace.GetNameError(Recipe.Name) ?? "";
|
||||
private BitmapSource? _previewImage;
|
||||
@ -103,7 +105,7 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
/// <summary>保存</summary>
|
||||
public DelegateCommand SaveCommand { get; private set; } = null!;
|
||||
|
||||
/// <summary>关闭编辑器,未保存的修改不写入文件</summary>
|
||||
/// <summary>确认保存后关闭编辑器</summary>
|
||||
public DelegateCommand CloseCommand { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
@ -114,8 +116,7 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
SaveCommand = new DelegateCommand(Save, () => !IsCapturing && !IsAgentBusy && NameValidationMessage.Length == 0);
|
||||
CloseCommand = new DelegateCommand(async () =>
|
||||
{
|
||||
_closingDialog = true; CloseCommand.RaiseCanExecuteChanged();
|
||||
await ShutdownAsync(); RequestClose.Invoke(ButtonResult.Cancel);
|
||||
if (await PrepareCloseAsync()) RequestClose.Invoke(ButtonResult.Cancel);
|
||||
}, () => !IsCapturing && !_closingDialog);
|
||||
CaptureStepKeyFrameCommand = new DelegateCommand(CaptureStepKeyFrame);
|
||||
TestStepDecisionCommand = new DelegateCommand(async () => await (_stepTestTask = TestStepDecisionAsync()),
|
||||
@ -165,7 +166,29 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool CanCloseDialog() => !IsCapturing;
|
||||
public bool CanCloseDialog() => _closeApproved;
|
||||
|
||||
public async Task<bool> PrepareCloseAsync()
|
||||
{
|
||||
if (_closeApproved) return true;
|
||||
if (_closingDialog || IsCapturing) return false;
|
||||
_closingDialog = true;
|
||||
CloseCommand.RaiseCanExecuteChanged();
|
||||
try
|
||||
{
|
||||
var choice = ConfirmCloseAsync is { } confirm ? await confirm() : RecipeCloseChoice.Cancel;
|
||||
if (choice == RecipeCloseChoice.Cancel) return false;
|
||||
if (choice == RecipeCloseChoice.Save && !TrySave()) return false;
|
||||
await ShutdownAsync();
|
||||
_closeApproved = true;
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_closingDialog = false;
|
||||
CloseCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnDialogClosed()
|
||||
@ -281,18 +304,20 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
private void Save() => TrySave();
|
||||
|
||||
private bool TrySave()
|
||||
{
|
||||
SaveStatus = "";
|
||||
if (RecipeWorkspace.GetNameError(Recipe.Name) is { } nameError)
|
||||
{
|
||||
SaveStatus = nameError;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var fileName = Recipe.Name;
|
||||
if (!_isNew && fileName != Path.GetFileNameWithoutExtension(_path))
|
||||
{ SaveStatus = "已有配方名与文件名一致,不可在编辑器中改名"; return; }
|
||||
{ SaveStatus = "已有配方名与文件名一致,不可在编辑器中改名"; return false; }
|
||||
|
||||
var path = string.IsNullOrEmpty(_path) ? Path.Combine(_directory, fileName, fileName + ".yaml") : _path;
|
||||
|
||||
@ -318,12 +343,15 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
SaveStatus = $"已保存 {Path.GetFileName(_path)}";
|
||||
StepTransferStatus = "";
|
||||
_onSaved?.Invoke(Path.GetFileName(_path));
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 写盘失败(文件被占用/只读)留给用户看,别让整个编辑器跟着炸
|
||||
Warnings.Clear();
|
||||
Warnings.Add("保存失败:" + ex.Message);
|
||||
SaveStatus = "保存失败:" + ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -361,3 +389,5 @@ public partial class RecipeEditorViewModel : BindableBase, IDialogAware
|
||||
|
||||
private void StepChanged(object? sender, PropertyChangedEventArgs e) => RefreshWarnings();
|
||||
}
|
||||
|
||||
public enum RecipeCloseChoice { Cancel, Save, Discard }
|
||||
|
||||
@ -86,6 +86,8 @@ internal static class Smoke
|
||||
var userCameraBefore=File.Exists(userCameraPath)?File.ReadAllBytes(userCameraPath):null;
|
||||
await Task.Delay(150);
|
||||
var app=(App)Application.Current!;var window=lifetime.MainWindow!;
|
||||
if(Environment.GetCommandLineArgs().Contains("--recipe-close-only"))
|
||||
{ await CheckRecipeClose(app,lifetime);_exit=0;return; }
|
||||
if(Environment.GetCommandLineArgs().Contains("--runtime-settings-only"))
|
||||
{
|
||||
var model=app.Container.Resolve<SopPageViewModel>();
|
||||
@ -206,10 +208,12 @@ internal static class Smoke
|
||||
Check(modal.Width==1180&&modal.Height==880&&modal.DataContext is RecipeEditorViewModel,"Edit command opens a recipe dialog sized for embedded annotation and training");
|
||||
Check(ReferenceEquals(((RecipeEditorViewModel)modal.DataContext!).SopRecording!.SelectedCamera,sop.SelectedCamera),"SOP recording inherits the runtime settings camera");
|
||||
((RecipeEditorViewModel)modal.DataContext!).CloseCommand.Execute();
|
||||
await ChooseRecipeClose(modal,"SaveRecipeAndCloseButton");
|
||||
for(var i=0;i<100&&lifetime.Windows.Contains(modal);i++)await Task.Delay(20);
|
||||
Check(!lifetime.Windows.Contains(modal),"Recipe close command respects the Prism dialog lifecycle");
|
||||
sop.EditRecipeCommand.Execute();await Task.Delay(150);
|
||||
var titlebarModal=lifetime.Windows.OfType<RecipeDialogWindow>().Single();titlebarModal.Close();
|
||||
await ChooseRecipeClose(titlebarModal,"DiscardRecipeAndCloseButton");
|
||||
for(var i=0;i<100&&lifetime.Windows.Contains(titlebarModal);i++)await Task.Delay(20);
|
||||
Check(!lifetime.Windows.Contains(titlebarModal),"Titlebar close awaits SOP camera shutdown and closes the Prism dialog");
|
||||
var recorder=new CameraWindow(new CameraViewModel(new FakeCamera(),Path.Combine(Path.GetTempPath(),"sophelper-avalonia-smoke")));
|
||||
@ -1047,6 +1051,42 @@ internal static class Smoke
|
||||
window.UpdateLayout();
|
||||
using var image=new RenderTargetBitmap(new PixelSize((int)window.Bounds.Width,(int)window.Bounds.Height));image.Render(window);image.Save(Path.Combine(Output,name+".png"));
|
||||
}
|
||||
private static async Task ChooseRecipeClose(Window owner,string buttonName)
|
||||
{
|
||||
for(var i=0;i<100&&!owner.OwnedWindows.Any();i++)await Task.Delay(20);
|
||||
var prompt=owner.OwnedWindows.Single();
|
||||
var buttons=prompt.GetVisualDescendants().OfType<Button>().ToArray();
|
||||
Check(owner.IsVisible&&buttons.Length==2,"关闭保存提示仅有保存并关闭和不保存两个按钮");
|
||||
buttons.Single(b=>b.Name==buttonName).RaiseEvent(new Avalonia.Interactivity.RoutedEventArgs(Button.ClickEvent));
|
||||
}
|
||||
private static async Task CheckRecipeClose(App app,IClassicDesktopStyleApplicationLifetime lifetime)
|
||||
{
|
||||
var root=Environment.GetEnvironmentVariable("SOPHELPER_WORKSPACE_ROOT")!;
|
||||
var store=new RecipeWorkspace(root);
|
||||
var config=new SopHelper.Engine.Sop.SopConfig();config.Sop.Name="Prism关闭保存";
|
||||
var callbacks=0;
|
||||
var dialogs=app.Container.Resolve<IDialogService>();
|
||||
dialogs.ShowDialog("RecipeEditorDialog",new DialogParameters{{"directory",store.RecipesDirectory},{"new",true},{"config",config},
|
||||
{"onSaved",new Action<string>(_=>callbacks++)}},_=>{});
|
||||
await Task.Delay(80);
|
||||
var modal=lifetime.Windows.OfType<RecipeDialogWindow>().Single();
|
||||
((RecipeEditorViewModel)modal.DataContext!).CloseCommand.Execute();
|
||||
await ChooseRecipeClose(modal,"SaveRecipeAndCloseButton");
|
||||
for(var i=0;i<100&&lifetime.Windows.Contains(modal);i++)await Task.Delay(20);
|
||||
Check(!lifetime.Windows.Contains(modal)&&File.Exists(store.ConfigPath(config.Sop.Name))&&callbacks==1,
|
||||
"Prism关闭按钮确认后保存一次并正常关闭");
|
||||
dialogs.ShowDialog("RecipeEditorDialog",new DialogParameters{{"directory",store.RecipesDirectory},{"new",false},{"config",config},
|
||||
{"path",store.ConfigPath(config.Sop.Name)}},_=>{});
|
||||
await Task.Delay(80);
|
||||
modal=lifetime.Windows.OfType<RecipeDialogWindow>().Single();
|
||||
var before=File.ReadAllBytes(store.ConfigPath(config.Sop.Name));
|
||||
((RecipeEditorViewModel)modal.DataContext!).Recipe.AddStepCommand.Execute();
|
||||
modal.Close();
|
||||
await ChooseRecipeClose(modal,"DiscardRecipeAndCloseButton");
|
||||
for(var i=0;i<100&&lifetime.Windows.Contains(modal);i++)await Task.Delay(20);
|
||||
Check(!lifetime.Windows.Contains(modal)&&before.SequenceEqual(File.ReadAllBytes(store.ConfigPath(config.Sop.Name))),
|
||||
"Prism右上角关闭确认不保存后释放资源并保留原文件");
|
||||
}
|
||||
private static void Check(bool condition,string message){if(!condition)throw new Exception(message);Console.WriteLine("PASS: "+message);}
|
||||
}
|
||||
internal sealed class FakeCamera : ICameraService
|
||||
|
||||
@ -125,7 +125,8 @@ internal static class AgentDraftVerificationChecks
|
||||
Check(File.ReadAllText(runningLog).Contains("cancelled_or_timeout") && File.ReadAllText(runningLog).Contains("session_end"),
|
||||
"Cancellation finishes the persistent log without losing earlier events");
|
||||
Check(model.Recipe.Steps.Count == 2 && File.ReadAllBytes(path).SequenceEqual(before), "Cancelling verification leaves the recipe untouched");
|
||||
Pump(model.ShutdownAsync()); window.Close(); model.OnDialogClosed();
|
||||
model.ConfirmCloseAsync = () => Task.FromResult(RecipeCloseChoice.Discard);
|
||||
Pump(model.ShutdownAsync()); window.Close(); Until(() => !window.IsVisible); model.OnDialogClosed();
|
||||
}
|
||||
|
||||
private static void Pump(Task task) { Until(() => task.IsCompleted); task.GetAwaiter().GetResult(); }
|
||||
|
||||
@ -35,6 +35,7 @@ internal static class Program
|
||||
CheckAiFlow();
|
||||
CheckSequenceEditor();
|
||||
StepTestDecisionChecks.Run();
|
||||
RecipeCloseChecks.Run(root);
|
||||
CheckRuntimeSettings(root);
|
||||
StepTransferChecks.Run(root);
|
||||
AgentDraftVerificationChecks.Run(root);
|
||||
@ -314,7 +315,8 @@ internal static class Program
|
||||
Check(!model.IsTestingFlow && !model.Playback.IsLoaded && model.Playback.FrameProcessor is null && model.Playback.FrameAnalyzer is null, "Closing the editor releases playback and flow detection");
|
||||
using (var exclusive = new FileStream(model.StandardVideoPath, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
|
||||
Check(exclusive.Length > 0, "Closing flow test unlocks the video file");
|
||||
window.Close(); vm.OnDialogClosed();
|
||||
vm.ConfirmCloseAsync = () => Task.FromResult(RecipeCloseChoice.Discard);
|
||||
window.Close(); Until(() => !window.IsVisible); vm.OnDialogClosed();
|
||||
}
|
||||
|
||||
private static void CheckRealtimePlayback(string path)
|
||||
|
||||
84
tests/VideoFlowTest.Smoke/RecipeCloseChecks.cs
Normal file
84
tests/VideoFlowTest.Smoke/RecipeCloseChecks.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using Avalonia.VisualTree;
|
||||
using Prism.Dialogs;
|
||||
using SopHelper.Engine.Sop;
|
||||
using SopHelper.Engine.Training;
|
||||
using SopHelper.VVMs.RecipeEditor;
|
||||
|
||||
internal static class RecipeCloseChecks
|
||||
{
|
||||
public static void Run(string root)
|
||||
{
|
||||
var store = new RecipeWorkspace(root);
|
||||
var config = new SopConfig(); config.Sop.Name = "关闭保存验证";
|
||||
var savedCalls = 0;
|
||||
RecipeEditorViewModel Create(bool isNew) {
|
||||
var model = new RecipeEditorViewModel();
|
||||
model.OnDialogOpened(new DialogParameters { { "directory", store.RecipesDirectory }, { "config", config },
|
||||
{ "path", isNew ? "" : store.ConfigPath(config.Sop.Name) }, { "new", isNew },
|
||||
{ "onSaved", new Action<string>(_ => savedCalls++) } });
|
||||
return model;
|
||||
}
|
||||
|
||||
var model = Create(true);
|
||||
var view = new RecipeEditor { DataContext = model };
|
||||
var window = new Window { Content = view, Width = 1040, Height = 800 };
|
||||
window.Show();
|
||||
window.Close();
|
||||
Until(() => window.OwnedWindows.Any());
|
||||
var prompt = window.OwnedWindows.Single();
|
||||
var buttons = prompt.GetVisualDescendants().OfType<Button>().ToArray();
|
||||
Check(window.IsVisible && buttons.Length == 2
|
||||
&& buttons.Any(b => b.Content?.ToString() == "保存并关闭") && buttons.Any(b => b.Content?.ToString() == "不保存")
|
||||
&& !File.Exists(store.ConfigPath(config.Sop.Name)), "关闭窗口先提示保存,仅提供保存和不保存两个按钮");
|
||||
buttons.Single(b => b.Name == "SaveRecipeAndCloseButton").RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
|
||||
Until(() => !window.IsVisible);
|
||||
Check(savedCalls == 1 && File.Exists(store.ConfigPath(config.Sop.Name)) && model.CanCloseDialog(),
|
||||
"确认保存后新配方落盘、回调一次并关闭窗口");
|
||||
model.OnDialogClosed();
|
||||
|
||||
var before = File.ReadAllBytes(store.ConfigPath(config.Sop.Name));
|
||||
model = Create(false);
|
||||
model.Recipe.AddStepCommand.Execute(); model.Recipe.SelectedStep!.Description = "不应落盘";
|
||||
view = new RecipeEditor { DataContext = model };
|
||||
window = new Window { Content = view }; window.Show(); window.Close();
|
||||
Until(() => window.OwnedWindows.Any());
|
||||
window.OwnedWindows.Single().GetVisualDescendants().OfType<Button>().Single(b => b.Name == "DiscardRecipeAndCloseButton")
|
||||
.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
|
||||
Until(() => !window.IsVisible);
|
||||
Check(before.SequenceEqual(File.ReadAllBytes(store.ConfigPath(config.Sop.Name))) && savedCalls == 1,
|
||||
"选择不保存时关闭窗口且保留原配方");
|
||||
model.OnDialogClosed();
|
||||
|
||||
model = Create(false);
|
||||
model.Recipe.AddStepCommand.Execute(); model.Recipe.SelectedStep!.Description = "确认后应保存";
|
||||
model.ConfirmCloseAsync = () => Task.FromResult(RecipeCloseChoice.Save);
|
||||
using (var locked = new FileStream(store.ConfigPath(config.Sop.Name), FileMode.Open, FileAccess.Read, FileShare.None))
|
||||
{
|
||||
var close = model.PrepareCloseAsync(); Pump(close);
|
||||
Check(!close.Result && !model.CanCloseDialog() && model.SaveStatus.Contains("保存失败") && model.CloseCommand.CanExecute(),
|
||||
"保存失败阻止关闭,显示错误且允许重试");
|
||||
}
|
||||
var retry = model.PrepareCloseAsync(); Pump(retry);
|
||||
Check(retry.Result && SopConfigLoader.Load(store.ConfigPath(config.Sop.Name)).Sop.Steps.Single().Description == "确认后应保存"
|
||||
&& savedCalls == 2, "解除占用后可以重试保存关闭,当前步骤修改持久化");
|
||||
model.OnDialogClosed();
|
||||
Console.WriteLine("PASS: 关闭保存确认、两按钮弹窗、新建与现有配方、放弃修改和保存失败重试");
|
||||
}
|
||||
|
||||
private static void Pump(Task task) { Until(() => task.IsCompleted); task.GetAwaiter().GetResult(); }
|
||||
private static void Until(Func<bool> ready)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
while (!ready() && watch.Elapsed < TimeSpan.FromSeconds(10))
|
||||
{
|
||||
using var cancellation = new CancellationTokenSource(5);
|
||||
Dispatcher.UIThread.MainLoop(cancellation.Token);
|
||||
}
|
||||
if (!ready()) throw new TimeoutException("关闭保存确认检查超时");
|
||||
Dispatcher.UIThread.RunJobs();
|
||||
}
|
||||
private static void Check(bool value, string message) { if (!value) throw new Exception(message); }
|
||||
}
|
||||
@ -72,6 +72,7 @@ internal static class StepTransferChecks
|
||||
Check(JsonSerializer.Serialize(model.Recipe.ToConfig()) == stable, "无效导入须保持当前编辑内容完整");
|
||||
foreach (var bad in new[] { "sop: { steps: [] }", "{}", "sop:\n steps: [null]", "not: a-sop" })
|
||||
{ try { SopStepTransfer.Read(bad); throw new Exception("无效文件不应被接受"); } catch (FormatException) { } }
|
||||
model.ConfirmCloseAsync = () => Task.FromResult(RecipeCloseChoice.Discard);
|
||||
window.Close(); model.OnDialogClosed();
|
||||
Console.WriteLine("PASS: 步骤导入导出全字段往返、追加替换、区域冲突映射、全局设置隔离、非法输入原子保护及界面入口");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user