优化代码

This commit is contained in:
liufei
2021-07-19 17:30:34 +08:00
parent cdbdae09c7
commit 4a8ddc4ce9
9 changed files with 69 additions and 29 deletions

View File

@@ -30,7 +30,8 @@ namespace GeekDesk
{
public static AppData appData = CommonCode.GetAppDataByFile();
public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
//public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
public static ToDoInfoWindow toDoInfoWindow;
public static int hotKeyId = -1;
public static int toDoHotKeyId = -1;
public static MainWindow mainWindow;
@@ -69,7 +70,7 @@ namespace GeekDesk
ShowApp();
}
RegisterHotKey(true);
RegisterCreateToDoHotKey(true);
//RegisterCreateToDoHotKey(true);
}
/// <summary>
@@ -126,7 +127,7 @@ namespace GeekDesk
if (appData.AppConfig.ToDoHotkeyModifiers!=0)
{
//加载完毕注册热键
toDoHotKeyId = Hotkey.Regist(new WindowInteropHelper(toDoInfoWindow).Handle, appData.AppConfig.ToDoHotkeyModifiers, appData.AppConfig.ToDoHotkey, () =>
toDoHotKeyId = Hotkey.Regist(new WindowInteropHelper(MainWindow.mainWindow).Handle, appData.AppConfig.ToDoHotkeyModifiers, appData.AppConfig.ToDoHotkey, () =>
{
if (MotionControl.hotkeyFinished)
{