public void TestDirectoryScanning() { LocalStorageScanner scanner = new LocalStorageScanner(); WatchSource source = new WatchSource(); source.SourceUri = new Uri("C:\\娱乐\\书籍"); scanner.Scanning(source, null); }
public void Scanning(WatchSource target, FindBookEventHandler handler) { this.Target = target; findBookEvents += handler; FindFile(Target.SourceUri.OriginalString); findBookEvents -= handler; }
public void Running() { lock (_gate) { WatchSource source = _changedSourceQueue.Dequeue(); List <IBookScanner> scanners = _serviceHost.GetFunctionExtensions <IBookScanner>(ExtensionCategory.ScanningExtension); foreach (IBookScanner scanner in scanners) { if (scanner.IsAcceptedSource(source)) { scanner.Scanning(source, this.MonitorFindBookEventHandler); break; } } ; } }
public SourceChangedEventArgs(WatchSource changedUri) { this.ChangedUri = changedUri; }
public bool IsAcceptedSource(WatchSource target) { return(true); }