Explorar o código

🚨 捕获异常, 取消崩溃通知

BookerLiu %!s(int64=2) %!d(string=hai) anos
pai
achega
8b2919c3b5

+ 25 - 17
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();
         }
 

+ 6 - 2
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) { }
         }
 
 

+ 1 - 1
Plugins/ShowSeconds/SecondsWindow.xaml.cs

@@ -235,7 +235,7 @@ namespace ShowSeconds
                         }
                     }
                     }
-                    catch (Exception) { }
+                    catch (Exception e1) { }
                 }));
             }
            

+ 1 - 1
Task/ToDoTask.cs

@@ -49,7 +49,7 @@ namespace GeekDesk.Task
                         }
                     }
                 }
-                catch (Exception) { }
+                catch (Exception e1) { }
                 //ClearMemory();
             }));
         }