Esempio n. 1
0
 public MonitoringService()
 {
     _parser          = new XmlParse("D:\\configuration.xml");
     _config          = _parser.GetConfig();
     watcher          = new FileSystemWatcher(_config.Source);
     watcher.Deleted += Watcher_Deleted;
     watcher.Created += Watcher_Created;
     watcher.Changed += Watcher_Changed;
     watcher.Renamed += Watcher_Renamed;
 }
Esempio n. 2
0
        private void StartParse(string path)
        {
            var xmlFormatter = new XmlSerializer(typeof(ConfigLayer));

            lock (new object())
            {
                using (var file = new FileStream(path, FileMode.Open))
                {
                    _config = (ConfigLayer)xmlFormatter.Deserialize(file);
                }
            }
        }