public void Run(string path, OnCreateHandler del) { try { _fileWatcher.RegisterHandler(del); _fileWatcher.Run(path); } catch (Exception ex) { throw ex; } }
public void Run() { try { string path = _settingManager.GetParam("watchingpath").ToString(); if (!_fileManager.CheckExistPath(path)) { path = _fileManager.CreateFolder(path).FullName; } //методы "обрабатывающие файл" OnCreateHandler del1 = _emailSenderHandler.SendWithAttach; OnCreateHandler del2 = _fileManager.DeleteFile; Delegate _delegate = Delegate.Combine(del1, del2); _fileWatcherHandler.Run(path, _delegate as OnCreateHandler); } catch (Exception ex) { throw ex; } }
public void RegisterHandler(OnCreateHandler del) { _del = del; }