AutoSquirrel.ShellView.ShellView_Closing C# (CSharp) Méthode

ShellView_Closing() private méthode

private ShellView_Closing ( object sender, System e ) : void
sender object
e System
Résultat void
        private void ShellView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var askSave = MessageBox.Show("Do you want save ?", "Exit Application", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            if (askSave == MessageBoxResult.Cancel)
            {
                e.Cancel = true;
                return;
            }

            if (askSave == MessageBoxResult.Yes)
                ((ShellViewModel)DataContext).Save();
        }