public void Start() { //TODO: how to find the services dir //TODO: how to get the bottles dir //TODO: do we need a custom config? string baseDir = ConfigurationManager.AppSettings["BottlesDirectory"] ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Bottles"); _fs = new DotNetFileSystem(); Magnum.FileSystem.Directory bottlesDir = _fs.GetDirectory(baseDir); _watcher = new BottleWatcher(); _cleanup = _watcher.Watch(bottlesDir.Name.GetPath(), CopyToServices); }
public void Stop() { _watcher = null; _cleanup.Dispose(); }