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;
        }
示例#2
0
        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;
        }