fix #41 优化待办任务

This commit is contained in:
liufei
2022-05-23 17:56:39 +08:00
parent 1a1350ee53
commit a7a2ee9f08
8 changed files with 248 additions and 12 deletions

View File

@@ -2,6 +2,8 @@
using GeekDesk.Util;
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
namespace GeekDesk
{
@@ -38,6 +40,7 @@ namespace GeekDesk
void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;//使用这一行代码告诉运行时该异常被处理了不再作为UnhandledException抛出了。
Mouse.OverrideCursor = null;
LogUtil.WriteErrorLog(e, "未捕获异常!");
if (Constants.DEV)
{
@@ -50,6 +53,18 @@ namespace GeekDesk
LogUtil.WriteErrorLog(e, "严重异常!");
MessageBox.Show("GeekDesk遇到未知问题崩溃!");
}
public static void DoEvents()
{
var frame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
new DispatcherOperationCallback(
delegate (object f)
{
((DispatcherFrame)f).Continue = false;
return null;
}), frame);
Dispatcher.PushFrame(frame);
}
}