Skip to content

Commit

Permalink
スタンドアロン版でエンコード中に終了しようとしたら警告を出すようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopanda committed Mar 23, 2019
1 parent ca95afc commit 7312312
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion AmatsukazeGUI/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,22 @@ private void Window_SourceInitialized(object sender, EventArgs e)

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
(DataContext as ViewModels.MainWindowViewModel)?.Model?.SaveWindowPlacement(this);
var vm = (DataContext as ViewModels.MainWindowViewModel);
if(vm != null && vm.Model.IsStandalone && vm.Model.IsRunning)
{
MessageBoxResult result = MessageBox.Show("エンコード中です。" +
"\r\n終了するとエンコード中の項目はすべてキャンセルされます。" +
"\r\n本当に終了しますか?", "Amatsukaze終了警告", MessageBoxButton.YesNo);
if (result != MessageBoxResult.Yes)
{
e.Cancel = true;
}
}

if (e.Cancel == false)
{
(DataContext as ViewModels.MainWindowViewModel)?.Model?.SaveWindowPlacement(this);
}
}
}
}

0 comments on commit 7312312

Please sign in to comment.