_proxyManager.UpdatePacFile();\r
PerformZoom();\r
_shipLabels.AdjustAkashiTimers();\r
- _sniffer.LoadState();\r
+ LoadState();\r
_sniffer.RepeatingTimerController = new RepeatingTimerController(_notificationManager, _config);\r
}\r
\r
handle = panel.Handle;\r
}\r
\r
+ private readonly FileSystemWatcher _watcher = new FileSystemWatcher\r
+ {\r
+ Path = AppDomain.CurrentDomain.BaseDirectory,\r
+ Filter = "status.xml",\r
+ NotifyFilter = NotifyFilters.LastWrite\r
+ };\r
+\r
+ private readonly Timer _watcherTimer = new Timer {Interval = 1000};\r
+\r
+ private void LoadState()\r
+ {\r
+ _sniffer.LoadState();\r
+ _watcher.SynchronizingObject = this;\r
+ _watcherTimer.Tick += (sender, ev) =>\r
+ {\r
+ _watcherTimer.Stop();\r
+ _sniffer.LoadState();\r
+ };\r
+ _watcher.Changed += (sender, ev) =>\r
+ {\r
+ _watcherTimer.Stop();\r
+ _watcherTimer.Start();\r
+ };\r
+ _watcher.EnableRaisingEvents = true;\r
+ }\r
+\r
private class RepeatingTimerController : Sniffer.IRepeatingTimerController\r
{\r
private readonly NotificationManager _manager;\r