public TreeWalker() { Mq = BlockingMq.GetMq(); FileTaskScheduler = SnaffCon.GetFileTaskScheduler(); TreeTaskScheduler = SnaffCon.GetTreeTaskScheduler(); FileScanner = SnaffCon.GetFileScanner(); }
internal void GetComputerShares(string computer) { // find the shares HostShareInfo[] hostShareInfos = GetHostShareInfo(computer); BlockingStaticTaskScheduler treeTaskScheduler = SnaffCon.GetTreeTaskScheduler(); foreach (HostShareInfo hostShareInfo in hostShareInfos) { string shareName = GetShareName(hostShareInfo, computer); if (!String.IsNullOrWhiteSpace(shareName)) { bool matched = false; // classify them foreach (ClassifierRule classifier in MyOptions.ShareClassifiers) { ShareClassifier shareClassifier = new ShareClassifier(classifier); if (shareClassifier.ClassifyShare(shareName)) { matched = true; break; } } // by default all shares should go on to TreeWalker unless the classifier pulls them out. // send them to TreeWalker if (!matched) { if (IsShareReadable(shareName)) { ShareResult shareResult = new ShareResult() { Listable = true, SharePath = shareName }; Mq.ShareResult(shareResult); Mq.Info("Creating a TreeWalker task for " + shareResult.SharePath); treeTaskScheduler.New(() => { try { new TreeWalker(shareResult.SharePath); } catch (Exception e) { Mq.Trace(e.ToString()); } }); } } } } }
public ShareFinder() { Mq = BlockingMq.GetMq(); TreeTaskScheduler = SnaffCon.GetTreeTaskScheduler(); TreeWalker = SnaffCon.GetTreeWalker(); }