-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
704 lines (598 loc) · 25.4 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using ControlzEx.Standard;
using CopyPlusPlus.Languages;
using CopyPlusPlus.Properties;
using Gma.System.MouseKeyHook;
using GoogleTranslateFreeApi;
using Hardcodet.Wpf.TaskbarNotification;
using Microsoft.Win32;
using Newtonsoft.Json;
using MouseEventArgs = System.Windows.Forms.MouseEventArgs;
namespace CopyPlusPlus
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public static TaskbarIcon NotifyIcon;
private static POINT _p;
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
private readonly IKeyboardMouseEvents _globalMouseKeyHook;
// 如果第一次切换到单个弹窗,则新开一个窗口,不把以前的窗口覆盖
private bool _firstlySwitch = true;
// 用于全局的功能开关
public bool GlobalSwitch = true;
// 用于图标弹窗的位置偏移
public int IconPopupX, IconPopupY;
public bool RemainChinese;
public bool RemainEnglish;
public string TranslateId;
public string TranslateKey;
public MainWindow()
{
InitializeComponent();
NotifyIcon = (TaskbarIcon)FindResource("MyNotifyIcon");
NotifyIcon.Visibility = Visibility.Visible;
IconPopupX = 8;
IconPopupY = 12;
// 读取 key
if (Settings.Default.AppID != "None" && Settings.Default.SecretKey != "None")
{
if (string.IsNullOrWhiteSpace(Settings.Default.AppID) ||
string.IsNullOrWhiteSpace(Settings.Default.SecretKey)) MessageBox.Show("请检查百度翻译的Key设置");
TranslateId = Settings.Default.AppID;
TranslateKey = Settings.Default.SecretKey;
}
else
{
TranslateId = null;
TranslateKey = null;
}
// 读取上次关闭时保存的每个Switch的状态
var checkList = Settings.Default.SwitchCheck.Cast<string>().ToList();
SwitchMain.IsOn = Convert.ToBoolean(checkList[0]);
SwitchSpace.IsOn = Convert.ToBoolean(checkList[1]);
SwitchWidth.IsOn = Convert.ToBoolean(checkList[2]);
SwitchTranslate.IsOn = Convert.ToBoolean(checkList[3]);
SwitchManyPopups.IsOn = Convert.ToBoolean(checkList[4]);
SwitchAutoStart.IsOn = Convert.ToBoolean(checkList[5]);
SwitchPopup.IsOn = Convert.ToBoolean(checkList[6]);
SwitchCopyOriginal.IsOn = Convert.ToBoolean(checkList[7]);
TransFromComboBox.SelectedIndex = Convert.ToInt32(checkList[8]);
TransToComboBox.SelectedIndex = Convert.ToInt32(checkList[9]);
TransEngineComboBox.SelectedIndex = Convert.ToInt32(checkList[10]);
SwitchSelectText.IsOn = Convert.ToBoolean(checkList[11]);
SwitchShortcut.IsOn = Convert.ToBoolean(checkList[12]);
RemainChinese = Settings.Default.RemainChinese;
RemainEnglish = Settings.Default.RemainEnglish;
// 按键绑定
_globalMouseKeyHook = Hook.GlobalEvents();
_globalMouseKeyHook.MouseDownExt += OnMouseDownExt;
_globalMouseKeyHook.MouseDragFinished += OnMouseDragFinished;
_globalMouseKeyHook.MouseWheel += OnMouseWheel;
var keySequence = Sequence.FromString("Control+C,Control+C");
Action actionAfterCopy = AfterKeySequence;
Hook.GlobalEvents().OnSequence(new Dictionary<Sequence, Action>
{
{ keySequence, actionAfterCopy }
});
}
private async void AfterKeySequence()
{
if (!GlobalSwitch) return;
if (SwitchShortcut.IsOn == false) return;
await Task.Delay(200);
if (Clipboard.ContainsText()) ProcessText(Clipboard.GetText());
}
[DllImport("user32.dll")]
[Obsolete]
private static extern bool GetCursorPos(out POINT lpPoint);
[Obsolete]
private static async void OnMouseDownExt(object sender, MouseEventArgs e)
{
if (e.Clicks != 1) return;
await Task.Delay(5);
Application.Current.Windows
.Cast<Window>()
.LastOrDefault(window => window is IconPopup)?.Close();
GetCursorPos(out _p);
}
private static void OnMouseWheel(object sender, MouseEventArgs e)
{
Application.Current.Windows
.Cast<Window>()
.LastOrDefault(window => window is IconPopup)?.Close();
}
[Obsolete]
private void OnMouseDragFinished(object sender, MouseEventArgs e)
{
if (!GlobalSwitch) return;
if (SwitchSelectText.IsOn == false) return;
//var clipboardBefore = Clipboard.GetText();
////var clipboardBefore = Clipboard.GetData(DataFormats.Rtf);
//Clipboard.Clear();
////await Task.Delay(11);
//Thread.Sleep(11);
//SendKeys.SendWait("^c");
////await Task.Delay(666);
//Thread.Sleep(1111);
//if (Clipboard.ContainsText())
try
{
var transform = PresentationSource.FromVisual(this).CompositionTarget.TransformFromDevice;
var mouse = transform.Transform(new Point(e.X, e.Y));
var iconPopup = new IconPopup
{
Left = mouse.X + IconPopupX,
Top = mouse.Y + IconPopupY,
MouseLocation = _p
//CopiedText = Clipboard.GetText()
};
iconPopup.Show();
}
catch
{
// ignored
}
//Clipboard.SetDataObject(clipboardBefore, true);
}
public void ProcessText(string text)
{
// 去掉 CAJ viewer 造成的莫名的空格符号
text = text.Replace("", "");
// 全角转半角
if (SwitchWidth.IsOn) text = text.Normalize(NormalizationForm.FormKC);
if (SwitchMain.IsOn || SwitchSpace.IsOn)
if (text.Length > 1)
for (var counter = 0; counter < text.Length; ++counter)
{
// 合并换行
if (SwitchMain.IsOn && counter >= 0 && text[counter] == '\r')
{
if (counter > 0)
{
// 如果检测到句号结尾,则不去掉换行
if (text[counter - 1] == '。' && RemainChinese) continue;
if (text[counter - 1] == '.' && RemainEnglish) continue;
}
// 去除换行
try
{
text = text.Remove(counter, 2);
}
catch
{
text = text.Remove(counter, 1);
}
--counter;
// 判断 非负数越界 或 句末
if (counter >= 0 && counter != text.Length - 1)
// 判断 非中文 结尾, 则加一个空格
if (!Regex.IsMatch(text[counter].ToString(), "[\n ,。?!《》\u4e00-\u9fa5]"))
text = text.Insert(counter + 1, " ");
}
// 去除空格
if (SwitchSpace.IsOn && counter >= 0 && text[counter] == ' ')
{
text = text.Remove(counter, 1);
--counter;
}
}
if (SwitchTranslate.IsOn)
{
var textBeforeTrans = text;
switch (TransEngineComboBox.Text)
{
case "百度翻译":
// 判断是否复制原文
if (SwitchCopyOriginal.IsOn)
{
ShowTrans(BdTrans(TranslateId, TranslateKey, text), textBeforeTrans);
}
else
{
text = BdTrans(TranslateId, TranslateKey, text);
ShowTrans(text, textBeforeTrans);
}
break;
case "谷歌翻译":
// 判断是否复制原文
if (SwitchCopyOriginal.IsOn)
{
ShowTrans(GoogleTrans(text), textBeforeTrans);
}
else
{
text = GoogleTrans(text);
ShowTrans(text, textBeforeTrans);
}
break;
case "DeepL":
DeepL(text);
break;
}
}
try
{
Clipboard.SetDataObject(text);
}
catch
{
Thread.Sleep(50);
Clipboard.SetDataObject(text);
}
}
private void SwitchManyPopups_OnToggled(object sender, RoutedEventArgs e)
{
if (!SwitchManyPopups.IsOn) _firstlySwitch = true;
}
// 翻译结果弹窗
private void ShowTrans(string text, string textBeforeTrans)
{
if (!SwitchPopup.IsOn || text == textBeforeTrans) return;
if (SwitchManyPopups.IsOn)
{
var translateResult = new TranslateResult { TextBox = { Text = text } };
// 每次弹窗启动位置偏移,未实现
//translateResult.WindowStartupLocation = WindowStartupLocation.Manual;
//translateResult.Left = System.Windows.Forms.Control.MousePosition.X;
//translateResult.Top = System.Windows.Forms.Control.MousePosition.Y;
translateResult.Show();
translateResult.TextBox.Focus();
}
else
{
if (_firstlySwitch)
{
var translateResult = new TranslateResult { TextBox = { Text = text } };
// 每次弹窗启动位置偏移,未实现
//translateResult.WindowStartupLocation = WindowStartupLocation.Manual;
//translateResult.Left = System.Windows.Forms.Control.MousePosition.X;
//translateResult.Top = System.Windows.Forms.Control.MousePosition.Y;
translateResult.Show();
translateResult.TextBox.Focus();
_firstlySwitch = false;
return;
}
// Get Window
if (!(Application.Current.Windows
.Cast<Window>()
.LastOrDefault(window => window is TranslateResult) is TranslateResult transWindow))
{
var translateResult = new TranslateResult { TextBox = { Text = text } };
translateResult.Show();
translateResult.TextBox.Focus();
}
else
{
transWindow.TextBox.Text = text;
}
}
}
private void Github_Click(object sender, RoutedEventArgs e)
{
Process.Start("explorer.exe", "https://github.com/CopyPlusPlus/CopyPlusPlus-NetFramework");
}
private string GoogleTrans(string text, bool detect = false)
{
// 初始化谷歌翻译
var translator = new GoogleTranslator();
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Language from;
if (TransFromComboBox.Text == "检测语言" || detect)
from = new Language("Automatic", "auto");
else
from = GoogleTranslator.GetLanguageByISO(GoogleLanguage.GetLanguage[TransFromComboBox.Text]);
var to = GoogleTranslator.GetLanguageByISO(GoogleLanguage.GetLanguage[TransToComboBox.Text]);
//var result = await translator.TranslateAsync(text, from, to);
//var text1 = text;
var result = Task.Run(async () => await translator.TranslateAsync(text, from, to));
if (result.Wait(TimeSpan.FromSeconds(4)))
return detect ? result.Result.LanguageDetections[0].Language.ISO639 : result.Result.MergedTranslation;
//Console.WriteLine($"Result 1: {result.MergedTranslation}");
// 返回值一直为null,所以不用了
//if (SwitchDictionary.IsOn)
//{
// if(result.Result.ExtraTranslations != null)
// return result.Result.ExtraTranslations.ToString();
//}
return detect ? "auto" : "翻译超时,请检查网络,或更换翻译平台。";
}
// 百度翻译,q为原文
private string BdTrans(string appId, string secretKey, string q = "apple")
{
if (appId == null)
{
// 生成随机数,随机读取API
var random = new Random();
var i = random.Next(0, Api.BaiduApi.GetLength(0) - 1);
TranslateId = Api.BaiduApi[i, 0];
TranslateKey = Api.BaiduApi[i, 1];
}
// 源语言
//var from = "auto";
var from = BaiduLanguage.GetLanguage[TransFromComboBox.Text];
// 目标语言
//var to = "zh";
var to = BaiduLanguage.GetLanguage[TransToComboBox.Text];
// 改成您的APP ID
//appId = NoAPI.baidu_id;
// 改成您的密钥
//secretKey = NoAPI.baidu_secretKey;
var rd = new Random();
var salt = rd.Next(100000).ToString();
var sign = EncryptString(appId + q + salt + secretKey);
var url = "http://api.fanyi.baidu.com/api/trans/vip/translate?";
url += "q=" + HttpUtility.UrlEncode(q);
url += "&from=" + from;
url += "&to=" + to;
url += "&appid=" + appId;
url += "&salt=" + salt;
url += "&sign=" + sign;
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "text/html;charset=UTF-8";
request.UserAgent = null;
request.Timeout = 6666;
HttpWebResponse response;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch
{
return "翻译超时,请检查网络,或更换翻译平台。。";
}
var myResponseStream = response.GetResponseStream();
var myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
var retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
// read json(retString) as a object
var result = JsonConvert.DeserializeObject<Rootobject>(retString)?.trans_result[0].dst;
return result ?? "翻译超时,请检查网络,或更换翻译平台。";
}
// 计算MD5值
public static string EncryptString(string str)
{
var md5 = MD5.Create();
// 将字符串转换成字节数组
var byteOld = Encoding.UTF8.GetBytes(str);
// 调用加密方法
var byteNew = md5.ComputeHash(byteOld);
// 将加密结果转换为字符串
var sb = new StringBuilder();
foreach (var b in byteNew)
// 将字节转换成16进制表示的字符串,
sb.Append(b.ToString("x2"));
// 返回加密的字符串
return sb.ToString();
}
// DeepL翻译
public void DeepL(string text)
{
text = text.Replace(" ", "%20");
Process.Start("https://www.deepl.com/translator#"
+ DeepLanguage.GetLanguage[TransFromComboBox.Text] + "/"
+ DeepLanguage.GetLanguage[TransToComboBox.Text] + "/" + text);
}
private void DeepL_OnSelected(object sender, RoutedEventArgs e)
{
TransFromComboBox.Items.RemoveAt(7);
TransFromComboBox.Items.RemoveAt(7);
TransToComboBox.Items.RemoveAt(6);
TransToComboBox.Items.RemoveAt(6);
}
private void DeepL_OnUnselected(object sender, RoutedEventArgs e)
{
TransFromComboBox.Items.Add(new ComboBoxItem { Content = "韩语" });
TransFromComboBox.Items.Add(new ComboBoxItem { Content = "繁体中文" });
TransToComboBox.Items.Add(new ComboBoxItem { Content = "韩语" });
TransToComboBox.Items.Add(new ComboBoxItem { Content = "繁体中文" });
}
private void Trans_OnToggled(object sender, RoutedEventArgs e)
{
SwitchPopup.IsEnabled = SwitchTranslate.IsOn;
SwitchManyPopups.IsEnabled = SwitchTranslate.IsOn;
SwitchCopyOriginal.IsEnabled = SwitchTranslate.IsOn;
//SwitchDictionary.IsEnabled = SwitchTranslate.IsOn;
}
private void TransEngineComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//_textLast = "";
// 为不同的翻译引擎设置不同的语言选项
if (TransEngineComboBox.Text == "谷歌翻译")
{
}
}
private void TransFromComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//_textLast = "";
}
private void TransToComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//_textLast = "";
}
// 鼠标右键 翻译开关 文字
private void TranslateText_Clicked(object sender, MouseButtonEventArgs e)
{
var keyInput = new KeyInput
{
Owner = this
};
keyInput.Show();
}
//private void SwitchUncheck(object sender, RoutedEventArgs e)
//{
// var switchButton = sender as ToggleSwitch;
// var switchName = switchButton.Name;
// if (switchName == "switch1") Switch1Check = false;
// if (switchName == "switch2") Switch2Check = false;
// if (switchName == "switch3") Switch3Check = false;
// if (switchName == "switch4") Switch4Check = false;
//}
//private void SwitchCheck(object sender, RoutedEventArgs e)
//{
// var switchButton = sender as ToggleSwitch;
// var switchName = switchButton.Name;
// if (switchName == "switch1") Switch1Check = true;
// if (switchName == "switch2") Switch2Check = true;
// if (switchName == "switch3") Switch3Check = true;
// if (switchName == "switch4") Switch4Check = true;
//}
private void MainWindow_Closed(object sender, EventArgs e)
{
// 记录每个Switch的状态,以便下次打开恢复
Settings.Default.SwitchCheck[0] = SwitchMain.IsOn.ToString();
Settings.Default.SwitchCheck[1] = SwitchSpace.IsOn.ToString();
Settings.Default.SwitchCheck[2] = SwitchWidth.IsOn.ToString();
Settings.Default.SwitchCheck[3] = SwitchTranslate.IsOn.ToString();
Settings.Default.SwitchCheck[4] = SwitchManyPopups.IsOn.ToString();
Settings.Default.SwitchCheck[5] = SwitchAutoStart.IsOn.ToString();
Settings.Default.SwitchCheck[6] = SwitchPopup.IsOn.ToString();
Settings.Default.SwitchCheck[7] = SwitchCopyOriginal.IsOn.ToString();
Settings.Default.SwitchCheck[8] = TransFromComboBox.SelectedIndex.ToString();
Settings.Default.SwitchCheck[9] = TransToComboBox.SelectedIndex.ToString();
Settings.Default.SwitchCheck[10] = TransEngineComboBox.SelectedIndex.ToString();
Settings.Default.SwitchCheck[11] = SwitchSelectText.IsOn.ToString();
Settings.Default.SwitchCheck[12] = SwitchShortcut.IsOn.ToString();
Settings.Default.Save();
}
private void MainWindow_OnStateChanged(object sender, EventArgs e)
{
if (WindowState != WindowState.Minimized) return;
//NotifyIcon.Visibility = Visibility.Visible;
NotifyIcon.ShowBalloonTip("Copy++", "软件已最小化至托盘,点击图标显示主界面,右键可退出", BalloonIcon.Info);
Hide();
}
private void MainWindow_Closing(object sender, CancelEventArgs e)
{
NotifyIcon.Visibility = Visibility.Visible;
NotifyIcon.ShowBalloonTip("Copy++", "软件已最小化至托盘,点击图标显示主界面,右键可退出", BalloonIcon.Info);
Hide();
e.Cancel = true;
}
public void HideNotifyIcon()
{
NotifyIcon.Visibility = Visibility.Visible;
}
public void CheckUpdate()
{
switch (Settings.Default.LastOpenDate.ToString("G", CultureInfo.GetCultureInfo("en-US")))
{
// 不再检查
case "7/24/1999 12:00:00 AM":
return;
// 第一次打开初始化日期
case "4/16/2021 12:00:00 AM":
Settings.Default.LastOpenDate = DateTime.Today;
Settings.Default.Save();
break;
default:
var daySpan = DateTime.Today.Subtract(Settings.Default.LastOpenDate);
if (daySpan.Days > 30)
{
var notifyUpdate = new
NotifyUpdate("打扰一下,您已经使用这个软件版本很久啦!\n\n或许已经有新版本了,欢迎前去公众号获取最新版。✨",
"知道啦", "别再提示")
{
Owner = this
};
notifyUpdate.Show();
}
break;
}
}
private void MainWindow_OnContentRendered(object sender, EventArgs e)
{
CheckUpdate();
}
private void ShowPay(object sender, MouseButtonEventArgs e)
{
var payMe = new PayMe
{
Owner = this
};
payMe.Show();
}
private void MeatDown(object sender, MouseButtonEventArgs e)
{
Meat.Text = "🦴";
}
private void MeatUp(object sender, MouseButtonEventArgs e)
{
Meat.Text = "🍖";
}
private void MeatLeave(object sender, System.Windows.Input.MouseEventArgs e)
{
Meat.Text = "🍖";
}
public void OnAutoStart(bool auto)
{
if (auto)
{
Show();
Hide();
NotifyIcon.Visibility = Visibility.Visible;
}
else
{
Show();
}
}
private void SwitchAutoStart_OnToggled(object sender, RoutedEventArgs e)
{
const string path = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
var key = Registry.CurrentUser.OpenSubKey(path, true);
if (key == null) return;
if (SwitchAutoStart.IsOn)
// 每次软件路径发生变化,系统会视为新软件,生成新的设置文件,因此不用担心路径发生变化
key.SetValue("CopyPlusPlus", Assembly.GetExecutingAssembly().Location + " /AutoStart");
else
key.DeleteValue("CopyPlusPlus", false);
}
private void ManualBtn_Click(object sender, RoutedEventArgs e)
{
Hide();
GlobalSwitch = false;
var manual = new Manual();
manual.Show();
}
private void OpenHandbook(object sender, RoutedEventArgs e)
{
Process.Start("https://wy-luke.gitee.io/HandBook/");
}
private void RemainOriginal(object sender, MouseButtonEventArgs e)
{
var remain = new RemainOriginal();
remain.Show();
}
private void DiyReplace(object sender, RoutedEventArgs e)
{
var addReplace = new AddReplace
{
Owner = this
};
addReplace.Show();
}
}
}