From 8b2919c3b5c7c895001816d391d83aa735ebe24c Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Sun, 23 Apr 2023 21:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20=E6=8D=95=E8=8E=B7=E5=BC=82?= =?UTF-8?q?=E5=B8=B8,=20=E5=8F=96=E6=B6=88=E5=B4=A9=E6=BA=83=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/PasswordDialog.xaml.cs | 42 ++++++++++++++--------- MainWindow.xaml.cs | 8 +++-- Plugins/ShowSeconds/SecondsWindow.xaml.cs | 2 +- Task/ToDoTask.cs | 2 +- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/Control/Other/PasswordDialog.xaml.cs b/Control/Other/PasswordDialog.xaml.cs index 143b7e1..76c8457 100644 --- a/Control/Other/PasswordDialog.xaml.cs +++ b/Control/Other/PasswordDialog.xaml.cs @@ -170,25 +170,33 @@ namespace GeekDesk.Control.Other new Thread(() => { Thread.Sleep(time); - Dispatcher.Invoke(() => + try { - if (string.IsNullOrEmpty(P1.Password)) + Dispatcher.Invoke(() => { - P1.Focus(); - return; - } - if (string.IsNullOrEmpty(P2.Password)) - { - P2.Focus(); - return; - } - if (string.IsNullOrEmpty(P3.Password)) - { - P3.Focus(); - return; - } - P4.Focus(); - }); + try + { + if (string.IsNullOrEmpty(P1.Password)) + { + P1.Focus(); + return; + } + if (string.IsNullOrEmpty(P2.Password)) + { + P2.Focus(); + return; + } + if (string.IsNullOrEmpty(P3.Password)) + { + P3.Focus(); + return; + } + P4.Focus(); + } + catch (Exception ex) { } + }); + } + catch (Exception e2) { } }).Start(); } diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 709d9eb..f86b1db 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -77,8 +77,12 @@ namespace GeekDesk private void Window_SourceInitialized(object sender, EventArgs e) { - //禁用窗口最大化 - WindowUtil.DisableMaxWindow(this); + try + { + //禁用窗口最大化 + WindowUtil.DisableMaxWindow(this); + } + catch (Exception) { } } diff --git a/Plugins/ShowSeconds/SecondsWindow.xaml.cs b/Plugins/ShowSeconds/SecondsWindow.xaml.cs index b521795..e1dfd34 100644 --- a/Plugins/ShowSeconds/SecondsWindow.xaml.cs +++ b/Plugins/ShowSeconds/SecondsWindow.xaml.cs @@ -235,7 +235,7 @@ namespace ShowSeconds } } } - catch (Exception) { } + catch (Exception e1) { } })); } diff --git a/Task/ToDoTask.cs b/Task/ToDoTask.cs index 77bfcae..62f7c1e 100644 --- a/Task/ToDoTask.cs +++ b/Task/ToDoTask.cs @@ -49,7 +49,7 @@ namespace GeekDesk.Task } } } - catch (Exception) { } + catch (Exception e1) { } //ClearMemory(); })); }