|
|
@ -22,6 +22,7 @@ using System.Text.Unicode;
|
|
|
|
using System.Net.Sockets;
|
|
|
|
using System.Net.Sockets;
|
|
|
|
using System.Security.Policy;
|
|
|
|
using System.Security.Policy;
|
|
|
|
using Prism.Events;
|
|
|
|
using Prism.Events;
|
|
|
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -29,82 +30,21 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public MainViewModel(WebsocketClient websocketClient, IEventAggregator ea)
|
|
|
|
public MainViewModel(WebsocketClient websocketClient, IEventAggregator ea)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string filter = "*.txt";
|
|
|
|
string filter = "*.index";
|
|
|
|
string str = File.ReadAllText("systemconfig.json");
|
|
|
|
string str = File.ReadAllText("systemconfig.json");
|
|
|
|
systemConfig = JsonSerializer.Deserialize<SystemConfig>(str);
|
|
|
|
systemConfig = JsonSerializer.Deserialize<SystemConfig>(str);
|
|
|
|
WatcherPath = systemConfig.FilePath;
|
|
|
|
WatcherPath = systemConfig.FilePath;
|
|
|
|
|
|
|
|
WatcherMseedPath= systemConfig.WatcherMseedPath;
|
|
|
|
|
|
|
|
MseedFilePath = systemConfig.MseedFilePath;
|
|
|
|
|
|
|
|
watcherArray[0] = new FileSystemWatcher();
|
|
|
|
|
|
|
|
watcherArray[1] = new FileSystemWatcher();
|
|
|
|
InitializeParams(filter);
|
|
|
|
InitializeParams(filter);
|
|
|
|
StartTime = DateTime.Now;
|
|
|
|
StartTime = DateTime.Now;
|
|
|
|
this._websocketClient = websocketClient;
|
|
|
|
|
|
|
|
this._ea = ea;
|
|
|
|
this._ea = ea;
|
|
|
|
_websocketClient.WebsocketError = WebSocket_Error;
|
|
|
|
// this._websocketClient = websocketClient;
|
|
|
|
_websocketClient.WebSocketMessageReceived = WebSocket4Net_MessageReceived;
|
|
|
|
// _websocketClient.WebsocketError = WebSocket_Error;
|
|
|
|
_websocketClient.WebSocketInit(systemConfig.Url);
|
|
|
|
// _websocketClient.WebSocketMessageReceived = WebSocket4Net_MessageReceived;
|
|
|
|
}
|
|
|
|
// _websocketClient.WebSocketInit(systemConfig.Url);
|
|
|
|
private void WebSocket4Net_MessageReceived(string message)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.WriteLine($"服务端回复数据:{message}!");
|
|
|
|
|
|
|
|
using (JsonDocument document = JsonDocument.Parse(message))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
JsonElement root = document.RootElement;
|
|
|
|
|
|
|
|
if (root.TryGetProperty("type", out JsonElement dataElement))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string type = dataElement.ToString();
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case CSMessage.sigin:
|
|
|
|
|
|
|
|
var user= JsonSerializer.Deserialize<SCUserSigin>(message, new JsonSerializerOptions
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 整齐打印
|
|
|
|
|
|
|
|
WriteIndented = true,
|
|
|
|
|
|
|
|
//重新编码,解决中文乱码问题
|
|
|
|
|
|
|
|
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if(user.code==200)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isLogin = true;
|
|
|
|
|
|
|
|
LoginContent = "登 出";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
HandyControl.Controls.MessageBox.Show(user.message, "warning");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.HideLoading();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSMessage.subscribe:
|
|
|
|
|
|
|
|
var sub= JsonSerializer.Deserialize<SCUserSubscribeMessage>(message, new JsonSerializerOptions
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 整齐打印
|
|
|
|
|
|
|
|
WriteIndented = true,
|
|
|
|
|
|
|
|
//重新编码,解决中文乱码问题
|
|
|
|
|
|
|
|
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSMessage.publish:
|
|
|
|
|
|
|
|
var publish = JsonSerializer.Deserialize<SCDevicePublish>(message, new JsonSerializerOptions
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 整齐打印
|
|
|
|
|
|
|
|
WriteIndented = true,
|
|
|
|
|
|
|
|
//重新编码,解决中文乱码问题
|
|
|
|
|
|
|
|
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (publish.serialNumber >= 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataList[publish.serialNumber - 1].IsSend = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void WebSocket_Error(SuperSocket.ClientEngine.ErrorEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//出错后隐藏加载窗口
|
|
|
|
|
|
|
|
this.HideLoading();
|
|
|
|
|
|
|
|
Debug.WriteLine("websocket_Error:" + e.Exception.ToString());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string watcherPath;
|
|
|
|
private string watcherPath;
|
|
|
|
|
|
|
|
|
|
|
@ -113,7 +53,21 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
get { return watcherPath; }
|
|
|
|
get { return watcherPath; }
|
|
|
|
set { SetProperty(ref watcherPath, value); }
|
|
|
|
set { SetProperty(ref watcherPath, value); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private string watcherMseedPath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string WatcherMseedPath
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return watcherMseedPath; }
|
|
|
|
|
|
|
|
set { SetProperty(ref watcherMseedPath, value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string mseedFilePath;
|
|
|
|
|
|
|
|
public string MseedFilePath
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return mseedFilePath; }
|
|
|
|
|
|
|
|
set { SetProperty(ref mseedFilePath, value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
private ObservableCollection<WatcherFileModel> dataList = new ObservableCollection<WatcherFileModel>();
|
|
|
|
private ObservableCollection<WatcherFileModel> dataList = new ObservableCollection<WatcherFileModel>();
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<WatcherFileModel> DataList
|
|
|
|
public ObservableCollection<WatcherFileModel> DataList
|
|
|
@ -187,13 +141,13 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
if (!isLogin)
|
|
|
|
if (!isLogin)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.ShowLoading();
|
|
|
|
this.ShowLoading();
|
|
|
|
_websocketClient.SiginServer(Account, Password);
|
|
|
|
// _websocketClient.SiginServer(Account, Password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isLogin = false;
|
|
|
|
isLogin = false;
|
|
|
|
LoginContent = "登 录";
|
|
|
|
LoginContent = "登 录";
|
|
|
|
_websocketClient.Closed();
|
|
|
|
// _websocketClient.Closed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -209,7 +163,6 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
timer1.Start();
|
|
|
|
timer1.Start();
|
|
|
|
timer1.Tick += timer1_Tick;
|
|
|
|
timer1.Tick += timer1_Tick;
|
|
|
|
IsIndeterminate = true;
|
|
|
|
IsIndeterminate = true;
|
|
|
|
_websocketClient.SendMes(JsonSerializer.Serialize(new CSUserSubscribeMessage { type = CSMessage.subscribe }));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Stop()
|
|
|
|
private void Stop()
|
|
|
@ -217,23 +170,33 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
WatchStartOrSopt(false);
|
|
|
|
WatchStartOrSopt(false);
|
|
|
|
timer1.Stop();
|
|
|
|
timer1.Stop();
|
|
|
|
IsIndeterminate = false;
|
|
|
|
IsIndeterminate = false;
|
|
|
|
_websocketClient.SendMes(JsonSerializer.Serialize(new CSUserSubscribeMessage { type = CSMessage.unsubscribe }));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public DelegateCommand FilePathSaveCommand => new(() =>
|
|
|
|
public DelegateCommand<object> FilePathSaveCommand => new((obj) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
|
|
|
|
System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
|
|
|
|
fbd.SelectedPath = WatcherPath;
|
|
|
|
string para = obj.ToString();
|
|
|
|
|
|
|
|
fbd.SelectedPath = (para == "WatcherPath") ? WatcherPath : watcherMseedPath;
|
|
|
|
fbd.Description = "请选择文件路径";
|
|
|
|
fbd.Description = "请选择文件路径";
|
|
|
|
fbd.ShowNewFolderButton = true;
|
|
|
|
fbd.ShowNewFolderButton = true;
|
|
|
|
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
|
|
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (fbd.SelectedPath != WatcherPath)
|
|
|
|
if (fbd.SelectedPath != WatcherPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (para == "WatcherPath")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WatcherPath = fbd.SelectedPath;
|
|
|
|
WatcherPath = fbd.SelectedPath;
|
|
|
|
|
|
|
|
watcherArray[0].Path = watcherPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherMseedPath = fbd.SelectedPath;
|
|
|
|
|
|
|
|
watcherArray[1].Path = watcherMseedPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
systemConfig.FilePath = WatcherPath;
|
|
|
|
systemConfig.FilePath = WatcherPath;
|
|
|
|
var options = new JsonSerializerOptions {
|
|
|
|
systemConfig.WatcherMseedPath = watcherMseedPath;
|
|
|
|
|
|
|
|
var options = new JsonSerializerOptions
|
|
|
|
|
|
|
|
{
|
|
|
|
// 整齐打印
|
|
|
|
// 整齐打印
|
|
|
|
WriteIndented = true,
|
|
|
|
WriteIndented = true,
|
|
|
|
//重新编码,解决中文乱码问题
|
|
|
|
//重新编码,解决中文乱码问题
|
|
|
@ -251,7 +214,14 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
private string settingDataPath = "systemconfig.json";
|
|
|
|
private string settingDataPath = "systemconfig.json";
|
|
|
|
private void timer1_Tick(object? sender, EventArgs e)
|
|
|
|
private void timer1_Tick(object? sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RunTime = DateDiff(DateTime.Now, StartTime);
|
|
|
|
DateTime currentT= DateTime.Now;
|
|
|
|
|
|
|
|
RunTime = DateDiff(currentT, StartTime);
|
|
|
|
|
|
|
|
string path = $"{MseedFilePath}/NET{currentT.Year.ToString("D4")}/{currentT.Month.ToString("D2")}/{currentT.Day.ToString("D2")}/{currentT.Hour.ToString("D2")}/{currentT.AddMinutes(-2).Minute.ToString("D2")}";
|
|
|
|
|
|
|
|
// path = "I:\\DATA/NET2023/06/22/22/56";
|
|
|
|
|
|
|
|
if (Directory.Exists(path))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UploadMseedFile.UploadMSeedOnce(path);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeParams(string fileFilter)
|
|
|
|
private void InitializeParams(string fileFilter)
|
|
|
@ -265,11 +235,19 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
IntervalTimesSource.Add(60);
|
|
|
|
IntervalTimesSource.Add(60);
|
|
|
|
SelectedIndex = 1;
|
|
|
|
SelectedIndex = 1;
|
|
|
|
//如果设置的目录不存在设置到根目录
|
|
|
|
//如果设置的目录不存在设置到根目录
|
|
|
|
if (!File.Exists(WatcherPath))
|
|
|
|
if (!Directory.Exists(WatcherPath))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WatcherPath = AppDomain.CurrentDomain.BaseDirectory;
|
|
|
|
WatcherPath = AppDomain.CurrentDomain.BaseDirectory;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
watcher = new FileSystemWatcher();
|
|
|
|
if (!Directory.Exists(watcherMseedPath))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherMseedPath = AppDomain.CurrentDomain.BaseDirectory;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
watcherArray[0].Path = watcherPath;
|
|
|
|
|
|
|
|
watcherArray[1].Path = watcherMseedPath;
|
|
|
|
|
|
|
|
//watcherArray = new FileSystemWatcher();
|
|
|
|
|
|
|
|
foreach (var watcher in watcherArray)
|
|
|
|
|
|
|
|
{
|
|
|
|
//初始化监听
|
|
|
|
//初始化监听
|
|
|
|
watcher.BeginInit();
|
|
|
|
watcher.BeginInit();
|
|
|
|
|
|
|
|
|
|
|
@ -283,9 +261,9 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
| NotifyFilters.Security
|
|
|
|
| NotifyFilters.Security
|
|
|
|
| NotifyFilters.Size;
|
|
|
|
| NotifyFilters.Size;
|
|
|
|
//设置监听的路径
|
|
|
|
//设置监听的路径
|
|
|
|
watcher.Path = WatcherPath;
|
|
|
|
// watcher.Path = WatcherPath;
|
|
|
|
watcher.Changed += new FileSystemEventHandler(Watcher_Changed);
|
|
|
|
watcher.Changed += new FileSystemEventHandler(Watcher_Changed);
|
|
|
|
// watcher.Created += Watcher_Created;
|
|
|
|
// watcherArray.Created += Watcher_Created;
|
|
|
|
watcher.Deleted += new FileSystemEventHandler(Watcher_Deleted);
|
|
|
|
watcher.Deleted += new FileSystemEventHandler(Watcher_Deleted);
|
|
|
|
watcher.Renamed += new RenamedEventHandler(Watcher_Renamed);
|
|
|
|
watcher.Renamed += new RenamedEventHandler(Watcher_Renamed);
|
|
|
|
watcher.Error += OnError;
|
|
|
|
watcher.Error += OnError;
|
|
|
@ -297,6 +275,7 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
//设置是否启用监听
|
|
|
|
//设置是否启用监听
|
|
|
|
watcher.EnableRaisingEvents = false;
|
|
|
|
watcher.EnableRaisingEvents = false;
|
|
|
|
watcher.EndInit();
|
|
|
|
watcher.EndInit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -329,12 +308,21 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private void Watcher_Changed(object sender, System.IO.FileSystemEventArgs e)
|
|
|
|
private void Watcher_Changed(object sender, System.IO.FileSystemEventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// DateTime dt = DateTime.Now;
|
|
|
|
|
|
|
|
// string tmp = dt.Hour.ToString() + "时" + dt.Minute.ToString() + "分" + dt.Second.ToString() + "秒" + dt.Millisecond.ToString() + "毫秒,目录发生变化\r\n";
|
|
|
|
// string tmp = dt.Hour.ToString() + "时" + dt.Minute.ToString() + "分" + dt.Second.ToString() + "秒" + dt.Millisecond.ToString() + "毫秒,目录发生变化\r\n";
|
|
|
|
DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath);
|
|
|
|
DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath);
|
|
|
|
watcher.EnableRaisingEvents = false;
|
|
|
|
var watch= sender as FileSystemWatcher;
|
|
|
|
Debug.WriteLine($"最后修改时间:{lastWriteTime}");
|
|
|
|
|
|
|
|
string lastLine = File.ReadAllLines(e.FullPath).Last().Trim();
|
|
|
|
string lastLine = File.ReadAllLines(e.FullPath).Last().Trim();
|
|
|
|
|
|
|
|
Debug.WriteLine($"最后修改时间:{lastWriteTime},文件路径:{watch.Path}");
|
|
|
|
|
|
|
|
if (watch != null && watch.Path == watcherArray[0].Path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherArray[0].EnableRaisingEvents = false;
|
|
|
|
|
|
|
|
UploadRealtimeFile.UploadRealtimeFileOnce(e.FullPath, lastLine);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (watch != null && watch.Path == watcherArray[1].Path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherArray[1].EnableRaisingEvents = false;
|
|
|
|
|
|
|
|
UploadPostproFile.UploadPostproFileOnce(watcherArray[1].Path, lastLine);
|
|
|
|
|
|
|
|
}
|
|
|
|
var str= dataList.Where(f => f.Data == lastLine).FirstOrDefault();
|
|
|
|
var str= dataList.Where(f => f.Data == lastLine).FirstOrDefault();
|
|
|
|
if (!string.IsNullOrWhiteSpace(lastLine)
|
|
|
|
if (!string.IsNullOrWhiteSpace(lastLine)
|
|
|
|
&& str==null)
|
|
|
|
&& str==null)
|
|
|
@ -350,18 +338,16 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
Data = lastLine,
|
|
|
|
Data = lastLine,
|
|
|
|
IsSend = false
|
|
|
|
IsSend = false
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
CSDevicePublish cSDevicePublish = new CSDevicePublish()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type = CSMessage.publish,
|
|
|
|
|
|
|
|
message = lastLine,
|
|
|
|
|
|
|
|
serialNumber = DataList.Count,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
string jsonStr = JsonSerializer.Serialize(cSDevicePublish);
|
|
|
|
|
|
|
|
_websocketClient.SendMes(jsonStr);
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
watcher.EnableRaisingEvents = true;
|
|
|
|
if (watch != null && watch.Path == watcherArray[0].Path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherArray[0].EnableRaisingEvents = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (watch != null && watch.Path == watcherArray[1].Path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
watcherArray[1].EnableRaisingEvents = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Watcher_Renamed(object sender, RenamedEventArgs e)
|
|
|
|
private void Watcher_Renamed(object sender, RenamedEventArgs e)
|
|
|
@ -422,13 +408,14 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
/// <param name="IsEnableRaising">True:启用监听,False:关闭监听</param>
|
|
|
|
/// <param name="IsEnableRaising">True:启用监听,False:关闭监听</param>
|
|
|
|
private void WatchStartOrSopt(bool IsEnableRaising)
|
|
|
|
private void WatchStartOrSopt(bool IsEnableRaising)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
watcher.EnableRaisingEvents = IsEnableRaising;
|
|
|
|
watcherArray[0].EnableRaisingEvents = IsEnableRaising;
|
|
|
|
|
|
|
|
watcherArray[1].EnableRaisingEvents = IsEnableRaising;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private FileSystemWatcher watcher = new FileSystemWatcher();
|
|
|
|
private FileSystemWatcher[] watcherArray = new FileSystemWatcher[2];
|
|
|
|
private DispatcherTimer timer1 = new DispatcherTimer();
|
|
|
|
private DispatcherTimer timer1 = new DispatcherTimer();
|
|
|
|
private SystemConfig systemConfig = new SystemConfig();
|
|
|
|
private SystemConfig systemConfig = new SystemConfig();
|
|
|
|
private readonly WebsocketClient _websocketClient;
|
|
|
|
// private readonly WebsocketClient _websocketClient;
|
|
|
|
private readonly IEventAggregator _ea;
|
|
|
|
private readonly IEventAggregator _ea;
|
|
|
|
|
|
|
|
|
|
|
|
protected void ShowLoading(string tip = "正在加载....")
|
|
|
|
protected void ShowLoading(string tip = "正在加载....")
|
|
|
|