2021-10-13 00:09:43 +08:00
|
|
|
|
using Microsoft.Office.Interop.PowerPoint;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
using Application = System.Windows.Application;
|
|
|
|
|
|
|
|
|
|
namespace Ink_Canvas
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for RestoreHiddenSlidesWindow.xaml
|
|
|
|
|
/// </summary>
|
2023-02-05 01:31:23 +08:00
|
|
|
|
public partial class YesOrNoNotificationWindow : Window
|
2021-10-13 00:09:43 +08:00
|
|
|
|
{
|
2023-02-05 01:31:23 +08:00
|
|
|
|
private readonly Action _yesAction;
|
|
|
|
|
private readonly Action _noAction;
|
|
|
|
|
|
|
|
|
|
public YesOrNoNotificationWindow(string text, Action yesAction = null, Action noAction = null)
|
2021-10-13 00:09:43 +08:00
|
|
|
|
{
|
2023-02-05 01:31:23 +08:00
|
|
|
|
_yesAction = yesAction;
|
|
|
|
|
_noAction = noAction;
|
2021-10-13 00:09:43 +08:00
|
|
|
|
InitializeComponent();
|
2023-02-05 01:31:23 +08:00
|
|
|
|
Label.Content = text;
|
2021-10-13 00:09:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonYes_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2023-02-05 01:31:23 +08:00
|
|
|
|
if (_yesAction == null)
|
2021-10-13 00:09:43 +08:00
|
|
|
|
{
|
2023-02-05 01:31:23 +08:00
|
|
|
|
Close();
|
|
|
|
|
return;
|
2021-10-13 00:09:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-05 01:31:23 +08:00
|
|
|
|
_yesAction.Invoke();
|
2021-10-13 00:09:43 +08:00
|
|
|
|
Close();
|
2023-02-05 01:31:23 +08:00
|
|
|
|
|
2021-10-13 00:09:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonNo_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2023-02-05 01:31:23 +08:00
|
|
|
|
if (_noAction == null)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_noAction.Invoke();
|
2021-10-13 00:09:43 +08:00
|
|
|
|
Close();
|
|
|
|
|
}
|
2021-10-13 00:39:46 +08:00
|
|
|
|
|
|
|
|
|
private void Window_Closed(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MainWindow.IsShowingRestoreHiddenSlidesWindow = false;
|
|
|
|
|
}
|
2021-10-13 00:09:43 +08:00
|
|
|
|
}
|
2023-02-05 01:31:23 +08:00
|
|
|
|
}
|