public PluginDirectory(string dir, bool includeSubdirectories) { if (dir == null) throw new ArgumentNullException("dir"); this.InitLog(); DirectoryInfo directory = new DirectoryInfo(dir); if (!directory.Exists) throw new ArgumentException(Resources.DirectoryDoesNotExist); IFileSystemWatcher fsw = new SafeEventFileSystemWatcher(new FileSystemWatcher(directory.FullName, "*.dll")); fsw.IncludeSubdirectories = includeSubdirectories; WatcherConnect(fsw, true); this.watcher.EnableRaisingEvents = true; }
public PluginDirectory(string dir, bool includeSubdirectories) { if (dir == null) { throw new ArgumentNullException("dir"); } this.InitLog(); DirectoryInfo directory = new DirectoryInfo(dir); if (!directory.Exists) { throw new ArgumentException(Resources.DirectoryDoesNotExist); } IFileSystemWatcher fsw = new SafeEventFileSystemWatcher(new FileSystemWatcher(directory.FullName, "*.dll")); fsw.IncludeSubdirectories = includeSubdirectories; WatcherConnect(fsw, true); this.watcher.EnableRaisingEvents = true; }