Example #1
0
 internal Watcher(string watchingDirectory, WatcherCreationOptions creationOptions)
 {
     WatchingDirectory    = watchingDirectory;
     ExpectingDirectories = creationOptions.ExpectingDirectories;
     WatchedDirectories   = creationOptions.WatchedDirectories;
     ExpectingFiles       = creationOptions.ExpectingFiles;
     WatchedFiles         = creationOptions.WatchedFiles;
     ScanOptions          = creationOptions.ScanOptions;
 }
Example #2
0
        public static WatcherManager CreateFromTree(WatchingTree tree)
        {
            if (tree == null)
            {
                throw new ArgumentNullException(nameof(tree));
            }
            List <WatchingTreeItem> watchPoints = RetriveWatchPoints(tree);
            List <Watcher>          watchers    = new List <Watcher>();
            string path;

            foreach (WatchingTreeItem watchPoint in watchPoints)
            {
                path = tree.PathOfItem(watchPoint);
                WatcherCreationOptions creationOptions = CollectNodes(watchPoint, path);
                watchers.Add(new Watcher(path, creationOptions));
            }
            return(new WatcherManager(watchers, tree));
        }