From 885b187128001a3d0ffa3fa19b3b929c3e0d438a Mon Sep 17 00:00:00 2001 From: mzhifa Date: Thu, 30 Nov 2023 17:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Txgy.FilesWatcher/ViewModels/MainViewModel.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Txgy.FilesWatcher/ViewModels/MainViewModel.cs b/Txgy.FilesWatcher/ViewModels/MainViewModel.cs index 4fc8101..da70c9c 100644 --- a/Txgy.FilesWatcher/ViewModels/MainViewModel.cs +++ b/Txgy.FilesWatcher/ViewModels/MainViewModel.cs @@ -336,7 +336,7 @@ namespace Txgy.FilesWatcher.ViewModels //设置监听文件类型 watcher.Filter = fileFilter; //设置是否监听子目录 - watcher.IncludeSubdirectories = false; + watcher.IncludeSubdirectories = true; //设置是否启用监听 watcher.EnableRaisingEvents = false; watcher.EndInit(); @@ -422,11 +422,13 @@ namespace Txgy.FilesWatcher.ViewModels { if (IsEnableRaising) { - watcherArray[0].Path = Path.Combine(MainPath, RealtimePath); - watcherArray[1].Path = Path.Combine(MainPath, PostPath); + if (IsUploadRealtimePath) + watcherArray[0].Path = Path.Combine(MainPath, RealtimePath); + if (IsUploadPostPath) + watcherArray[1].Path = Path.Combine(MainPath, PostPath); } - watcherArray[0].EnableRaisingEvents = IsEnableRaising; - watcherArray[1].EnableRaisingEvents = IsEnableRaising; + watcherArray[0].EnableRaisingEvents =IsUploadRealtimePath; + watcherArray[1].EnableRaisingEvents = IsUploadPostPath; IsIndeterminate = IsEnableRaising; } catch (Exception ex)