提交记录修改Core/Servicers/Instances/Main.cs+2 −17看文件
修改Core/Servicers/Instances/Observer.cs+12 −12看文件
| @@ -37,13 +37,6 @@ namespace Core.Servicers.Instances | ||
| 37 | 37 | "OpenWith", |
| 38 | 38 | "Updater", |
| 39 | 39 | "LockApp", |
| 40 | 删除: "", | |
| 41 | 删除: "", | |
| 42 | 删除: "", | |
| 43 | 删除: "", | |
| 44 | 删除: "", | |
| 45 | 删除: "", | |
| 46 | 删除: | |
| 47 | 40 | }; |
| 48 | 41 | |
| 49 | 42 | /// <summary> |
| @@ -249,20 +242,10 @@ namespace Core.Servicers.Instances | ||
| 249 | 242 | activeProcessFile = file; |
| 250 | 243 | |
| 251 | 244 | activeStartTime = DateTime.Now; |
| 252 | 删除: | |
| 253 | 删除: //activeSeconds = 0; | |
| 254 | 删除: //if (!activeTimer.Enabled) | |
| 255 | 删除: //{ | |
| 256 | 删除: // activeTimer.Start(); | |
| 257 | 删除: //} | |
| 258 | 删除: | |
| 259 | 删除: | |
| 260 | 245 | } |
| 261 | 246 | else |
| 262 | 247 | { |
| 263 | 248 | activeProcess = null; |
| 264 | 删除: //activeSeconds = 0; | |
| 265 | 删除: //activeTimer.Stop(); | |
| 266 | 249 | } |
| 267 | 250 | } |
| 268 | 251 | |
| @@ -344,6 +327,8 @@ namespace Core.Servicers.Instances | ||
| 344 | 327 | // 关联进程更新 |
| 345 | 328 | HandleLinks(activeProcess, seconds); |
| 346 | 329 | |
| 330 | 新增: activeStartTime = DateTime.Now; | |
| 331 | 新增: | |
| 347 | 332 | OnUpdateTime?.Invoke(this, null); |
| 348 | 333 | } |
| 349 | 334 | } |
| @@ -22,7 +22,7 @@ namespace Core.Servicers.Instances | ||
| 22 | 22 | public event ObserverEventHandler OnAppActive; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 删除: private string activeProcessName, activeProcessFile = null; | |
| 25 | 新增: //private string activeProcessName, activeProcessFile = null; | |
| 26 | 26 | public Observer() |
| 27 | 27 | { |
| 28 | 28 | winEventDelegate = new Win32API.WinEventDelegate(WinEventProc); |
| @@ -138,17 +138,17 @@ namespace Core.Servicers.Instances | ||
| 138 | 138 | private void EventInvoke(string processName, string description, string filename) |
| 139 | 139 | { |
| 140 | 140 | // 防止重复和错误响应 |
| 141 | 删除: if (string.IsNullOrEmpty(processName) || string.IsNullOrEmpty(filename) || !File.Exists(filename)) | |
| 142 | 删除: { | |
| 143 | 删除: return; | |
| 144 | 删除: } | |
| 145 | 删除: if (filename == activeProcessFile && processName == activeProcessName) | |
| 146 | 删除: { | |
| 147 | 删除: return; | |
| 148 | 删除: } | |
| 149 | 删除: | |
| 150 | 删除: activeProcessName = processName; | |
| 151 | 删除: activeProcessFile = filename; | |
| 141 | 新增: //if (string.IsNullOrEmpty(processName) || string.IsNullOrEmpty(filename) || !File.Exists(filename)) | |
| 142 | 新增: //{ | |
| 143 | 新增: // return; | |
| 144 | 新增: //} | |
| 145 | 新增: //if (filename == activeProcessFile && processName == activeProcessName) | |
| 146 | 新增: //{ | |
| 147 | 新增: // return; | |
| 148 | 新增: //} | |
| 149 | 新增: | |
| 150 | 新增: //activeProcessName = processName; | |
| 151 | 新增: //activeProcessFile = filename; | |
| 152 | 152 | |
| 153 | 153 | OnAppActive?.Invoke(processName, description, filename); |
| 154 | 154 | } |

